Skip to content

Instantly share code, notes, and snippets.

@buth
buth / Dockerfile
Last active May 2, 2024 05:37
Docker Install ImageMagick
RUN \
curl -sfLO http://www.imagemagick.org/download/ImageMagick-6.9.0-4.tar.gz && \
echo 'cf51a1c6ebf627c627a8e6ac20aecce5f1425907c2cdb98c5a60f329c5c6caf2 ImageMagick-6.9.0-4.tar.gz' | sha256sum -c - && \
tar -xzf ImageMagick-6.9.0-4.tar.gz && \
cd ImageMagick-6.9.0-4 && \
./configure --prefix /usr/local && \
make install && \
cd .. && \
rm -rf ImageMagick*
@kiley0
kiley0 / material-design-colors.js
Created February 17, 2018 15:42
Array of Google Material Design color hex codes
const mdColors = [
'#F44336',
'#FFEBEE',
'#FFCDD2',
'#EF9A9A',
'#E57373',
'#EF5350',
'#F44336',
'#E53935',
'#D32F2F',
@airalcorn2
airalcorn2 / hook_transformer_attn.py
Last active May 2, 2024 05:37
A simple script for extracting the attention weights from a PyTorch Transformer.
# Inspired by: https://towardsdatascience.com/the-one-pytorch-trick-which-you-should-know-2d5e9c1da2ca.
# Monkey patching idea suggested by @kklemon here:
# https://gist.github.com/airalcorn2/50ec06517ce96ecc143503e21fa6cb91?permalink_comment_id=4407423#gistcomment-4407423.
import torch
from torch import nn
def patch_attention(m):
@raquelhortab
raquelhortab / action.yml
Last active May 2, 2024 05:36
action.yml for github action to automate tests
# action.yml
name: 'Hello World'
description: 'Run tests'
runs:
using: 'docker'
# this corresponds to the location of the dockerfile, relative to your action's folder (automatic-tests here)
image: '../../../Dockerfile'
@jackblk
jackblk / squid_proxy_tutorial.md
Last active May 2, 2024 05:35
Tutorial on how to setup a squid proxy with authentication.

Note

This tutorial is for Ubuntu & Squid3. Use AWS, Google cloud, Digital Ocean or any services with Ubuntu to follow this tutorial.

Install squid & update

sudo apt-get update
sudo apt-get install squid3
sudo apt-get install apache2-utils
@raquelhortab
raquelhortab / build.gradle (app)
Last active May 2, 2024 05:35
Crashlytics migration errors
def versionMajor = 1
def versionMinor = 1
def versionPatch = 3
def versionBuild = 0
buildscript {
repositories {
mavenCentral()
// maven { url 'https://maven.fabric.io/public' }
@raquelhortab
raquelhortab / main.yml
Last active May 2, 2024 05:35
Main workflow for test automation with github actions
name: CI
# this will fire the action on any push to the master branch, you can modify the branch or adapt it to be fired on other events (eg. pull requests)
on:
push:
branches:
- master
jobs:
build:
@mage1k99
mage1k99 / how_to_install.md
Last active May 2, 2024 05:33
How to install WordPress with caddy2

How to Install WordPress in Caddy 2

PHP Version : 8.0 Wordpress version : 5.7.2 Caddy version : v2.4.3


Note!

This one is outdated: please check the offical guide here

@bmaupin
bmaupin / gammu-wammu.md
Last active May 2, 2024 05:33
Export feature phone SMS using Gammu/Wammu

General notes

SMS

Gammu/Wammu may not be able to retrieve dates for sent messages, only received messages.

MMS

MMS messages may not be able to be exported using Gammu/Wammu with some phones. If you don't see MMS in the exported messages, you may be able to save the message attachments to the phone's storage and copy them to a PC via a USB cable.

@remarkablemark
remarkablemark / phaser-toss-the-turtle-demo.js
Created April 26, 2024 19:00
Phaser: Toss the Turtle prototype
class Example extends Phaser.Scene
{
preload() {
this.load.image('backdrop', 'assets/pics/platformer-backdrop.png');
this.load.image('cannon_head', 'assets/tests/timer/cannon_head.png');
this.load.image('cannon_body', 'assets/tests/timer/cannon_body.png');
this.load.spritesheet('chick', 'assets/sprites/chick.png', { frameWidth: 16, frameHeight: 18 });
}
create() {