Skip to content

Instantly share code, notes, and snippets.

@ricco386
ricco386 / btrfs-scrub-pictures
Last active July 5, 2022 07:20
Systemd timer for BTRFS Scrub. Usage: systemctl enable btrfs-scrub@pictures.timer
# /etc/conf.d/btrfs-scrub-pictures
mountpoint=/data/pictures
@rgrove
rgrove / README.md
Created February 8, 2016 19:01
Cake's approach to React Router server rendering w/code splitting and Redux

Can't share the complete code because the app's closed source and still in stealth mode, but here's how I'm using React Router and Redux in a large app with server rendering and code splitting on routes.

Server

  1. Wildcard Express route configures a Redux store for each request and makes an addReducers() callback available to the getComponents() method of each React Router route. Each route is responsible for adding any Redux reducers it needs when it's loaded. (This isn't really necessary on the
@rvagg
rvagg / install-node.sh
Last active April 2, 2024 16:51
install-node.sh - simple script to fetch and install Node.js releases and nightlies on Linux (x86, x64 & ARM) and OS X
#!/bin/bash
# Note your /usr/local will need to be writable by the user running it,
# alternatively run it with `sudo`
hasxz=$(which xzcat)
os=$(uname | tr '[A-Z]' '[a-z]')
arch=$(uname -m)
targetdir="/usr/local/"
domain=nodejs.org
@wrumsby
wrumsby / Gruntfile.js
Last active December 15, 2015 14:39
Gruntfile that uses grunt-shell to run grover.
module.exports = function(grunt) {
'use strict';
var files = ['src/**/*.js', 'test/**/*.js'];
grunt.initConfig({
jshint: {
options: {
jshintrc: '.jshintrc'
},
@temoto
temoto / aes-cfb-example.go
Created February 27, 2013 22:37
Example of AES (Rijndael) CFB encryption in Go. IMHO, http://golang.org/pkg/crypto/cipher/ could benefit a lot from similar snippet.
package main
import (
"crypto/aes"
"crypto/cipher"
"fmt"
)
func EncryptAESCFB(dst, src, key, iv []byte) error {
aesBlockEncrypter, err := aes.NewCipher([]byte(key))
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@unbracketed
unbracketed / export_repo_issues_to_csv.py
Last active August 3, 2023 18:13
Export Issues from Github repo to CSV (API v3)
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests
@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one