Skip to content

Instantly share code, notes, and snippets.

View dealloc's full-sized avatar

Wannes Gennar dealloc

View GitHub Profile
@dealloc
dealloc / cmder.reg
Last active August 29, 2015 14:24
handy cmder context menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\directory\background\shell\open with Cmder]
"Icon"="C:\\Program Files (x86)\\cmder\\Cmder.exe"
[HKEY_CLASSES_ROOT\directory\background\shell\open with Cmder\command]
@="\"C:\\Program Files (x86)\\cmder\\Cmder.exe\" /START \"%V\""
[HKEY_CLASSES_ROOT\directory\shell\open with Cmder]
@dealloc
dealloc / app.css
Created September 3, 2015 16:33
fancy CSS3 underline
/* ripped from semantic-ui.com */
a
{
display: inline-block;
position: relative;
overflow: hidden;
vertical-align: top;
z-index: 0;
-webkit-transition: color 0.2s;
@dealloc
dealloc / sudo_once.sh
Created March 25, 2016 20:02
prompt sudo once and forget about it
startsudo()
{
sudo -v
( while true; do sudo -v; sleep 50; done; ) &
SUDO_PID="$!"
trap stopsudo SIGINT SIGTERM
}
stopsudo()
{
kill "$SUDO_PID"
@dealloc
dealloc / cryptor.js
Last active May 2, 2017 17:49
simple AES en/decryption
export default class Cryptor {
constructor() {
this.AES_ALGO = 'AES-CBC';
this.DERIVE_ALGO = 'PBKDF2';
this.HASH_ALGO = 'SHA-256';
this.KEY_BITS = 256;
this.KEY_ITERATIONS = 1000;
}
encrypt(data, password) {
@dealloc
dealloc / Dockerfile
Last active October 7, 2020 18:45
Elixir Docker makefile
FROM elixir:alpine
WORKDIR /app
ARG USER_UID
ARG UNAME
EXPOSE 4000
RUN apk add --no-cache curl bash
RUN curl --url https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh --output /wait-for-it.sh
COPY ./docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
@dealloc
dealloc / docker-compose.yml
Last active August 8, 2018 14:49
Gitlab docker
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'localhost'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://localhost:9090'
gitlab_rails['gitlab_shell_ssh_port'] = 2224
gitlab_rails['backup_path'] = '/var/opt/gitlab/backups'
ports:
@dealloc
dealloc / install.sh
Last active October 5, 2018 08:47
Small shell script that automatically installs Arch (configured to work on my Laptop)
#!/bin/bash
clear
set -e
# Set keyboard
echo "Setting keyboard layout..."
loadkeys be-latin1
# Prompting for variables as required
echo "Getting required data..."
PASSWORD=$(dialog --clear --stdout --backtitle "Arch installer" --no-shadow --title "Enter password for users" --passwordbox "Please enter a strong password for the root user.\n" 8 60 2> /dev/null)
@dealloc
dealloc / setup-debian.sh
Created January 1, 2020 20:41
WSL debian setup script
#!/bin/bash
# Update APT repositories
sudo apt-get update
# Now, install stuff we need.
sudo apt-get install -y vim git curl wget htop postgresql gnupg zsh
# Setup Elixir repositories
cd /tmp
@dealloc
dealloc / echo_socket.ex
Created October 10, 2020 12:19
Echo socket demo
defmodule PooledConnWeb.Socket.EchoSocket do
@moduledoc """
Javascript code to run this (put in .html.eex file):
const id = <%= :rand.uniform(10) %>;
const websocket = new WebSocket('ws://localhost:4000/socket/websocket?id=' + id);
websocket.onopen = (args) => console.info('Open', args);
websocket.onmessage = (msg, args) => console.info('Message', msg, args);
websocket.onclose = (args) => console.warn('Close', args);
"""
@dealloc
dealloc / .dockerignore
Created March 15, 2021 15:27
Phoenix Dockerfile
_build/
.elixir_ls/
assets/node_modules/
deps/
priv/static