Skip to content

Instantly share code, notes, and snippets.

View olalonde's full-sized avatar

Oli olalonde

View GitHub Profile
" Vim color scheme
"
" Name: railscat.vim
" Maintainer: Jeff Kreeftmeijer
" License: public domain
"
" A GUI only extended version of the Railscasts+ theme, that comes with
" Janus [1] and is, in turn, an extension to the original Railscasts theme
" [2], which is a port of the RailsCasts TextMate theme [3] to Vim.
"
@ramnathv
ramnathv / automate_ghpages.md
Created October 4, 2012 19:10
Automating Github Pages Workflow

Problem

You have git repository with the following directory structure

myproject
|- source
|- docs
|- README.md
const {
topLevel: {
intermediate, // declaration of intermediate
intermediate: {
nested // declaration of nested
}
}
} = {
topLevel: {
intermediate: {
@brettz9
brettz9 / encodeRFC5987ValueChars.js
Last active November 5, 2016 22:58
encodeRFC5987ValueChars
// Posted at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
var fileName = 'my file(2).txt';
var header = "Content-Disposition: attachment; filename*=UTF-8''" + encodeRFC5987ValueChars(fileName);
console.log(header);
// logs "Content-Disposition: attachment; filename*=UTF-8''my%20file%282%29.txt"
function encodeRFC5987ValueChars (str) {
return encodeURIComponent(str).
anonymous
anonymous / example.js
Created December 17, 2016 03:15
const userRouter = new Router()
.get('/', users.show)
.use(userIsAdminMiddleware)
.put('/', users.update)
.del('/', users.destroy)
app
.use('/users', new Router()
.use('/:username', userRouter)
.get('/', users.list)
anonymous
anonymous / index.js
Created December 17, 2016 03:09
app
.use('/users', new Router()
.use('/:username', new Router()
.get('/', users.show)
// want to add authorization just for update/delete? sure buddy
.use(userIsAdminMiddleware)
.put('/', users.update)
.del('/', users.destroy)
)
.get('/', users.list)
@gionn
gionn / .gitignore
Last active January 16, 2017 23:53
Infrastructure as Code with Terraform
.env
terraform.tfstate*
import { createAction } from 'redux-actions';
import * as WebUtils from '../webUtils/index';
import {
SELECT_MEAL,
UPDATE_MEAL_PROP,
BEGIN_CREATING_MEAL,
SUCCESS_CREATING_MEAL,
ERROR_CREATING_MEAL,
BEGIN_LOADING_MEALS,
// First 21-digit prime number found in consecutive digits of e
// answer:
// 957496696762772407663
//
// in hexadecimal:
// 33E7EF9CABBAF6C56F
const bitcore = require("bitcore-lib");
const { PrivateKey, HDPrivateKey } = bitcore;
@Couto
Couto / webpack.js
Last active November 11, 2020 17:53
Fetch polyfill with webpack
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var folders = {
APP: path.resolve(__dirname, '../app'),
BUILD: path.resolve(__dirname, '../build'),
BOWER: path.resolve(__dirname, '../bower_components'),
NPM: path.resolve(__dirname, '../node_modules')
};