Skip to content

Instantly share code, notes, and snippets.

From 3a8fe43e9e073f26e44f62ad072079acd8b78de3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Bu=CC=88nemann?= <buenemann@louis.info>
Date: Mon, 30 May 2016 00:00:29 +0200
Subject: [PATCH] Add SPDY support back to Nginx with HTTP/2
Ported to 1.9.15 from 1.9.7 patch by Jiale Zhi from CloudFlare with
additional fixes to re-enable deprecated spdy directives and fix
compilation with http_v2 module enabled and spdy disabled.
---
auto/modules | 31 +
@zmactep
zmactep / Functor.scala
Created May 17, 2016 09:04
Scala Functor
/*
class Functor f where
fmap :: (a -> b) -> f a -> f b
*/
trait Functor[F[_]] {
def fmap[A, B](f : F[A])(g : A => B) : F[B]
}
@pawal
pawal / clean-zone.sh
Created April 22, 2016 13:39
Get a list of delegated domains from a zone
#!/bin/sh
awk '{
if (match($0,"^$")) # remove empty lines
skip = $1
else if (match($0,"^;")) # remove comment lines
skip = $1
else if ($1 == "se.") # remove our own zone
skip = $1
else if ($1 == "nu.") # remove our own zone
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active November 21, 2025 07:55
Vanilla JavaScript Quick Reference / Cheatsheet
@hmemcpy
hmemcpy / ramdisk.md
Last active April 6, 2025 02:53
RAMDisk benchmarks
@aviskase
aviskase / bash_colors.sh
Last active February 14, 2024 01:43
Custom bash prompt. Sets git branch (colored) and virtualenv
# Reset
Reset='\[\e[0m\]' # Text Reset
# Common colors
Black='\[\e[0;30m\]' # Black
Red='\[\e[0;31m\]' # Red
Green='\[\e[0;32m\]' # Green
Yellow='\[\e[0;33m\]' # Yellow
Blue='\[\e[0;34m\]' # Blue
Purple='\[\e[0;35m\]' # Purple
@santisbon
santisbon / XMLHttpRequestLoadImagePromise.js
Last active September 23, 2025 21:43
Using XMLHttpRequest to load an image in a javascript promise. Based on Mozilla Developer Network documentation.
/*jslint devel: true, browser: true, es5: true */
/*global Promise */
function imgLoad(url) {
'use strict';
// Create new promise with the Promise() constructor;
// This has as its argument a function with two parameters, resolve and reject
return new Promise(function (resolve, reject) {
// Standard XHR to load an image
var request = new XMLHttpRequest();
@roman01la
roman01la / app.js
Last active September 9, 2017 06:49
Minimal setup for efficient state management and rendering in React with single atom state
import React from 'react';
import { render } from 'react-dom';
import Root from './components/root.jsx';
import { silentSwap } from './lib/atom';
import { fromJS } from 'immutable';
import './stores/ui';
const initialState = {
ui: {
/**
* UserController
*
* @description :: Server-side logic for managing users
* @help :: See http://links.sailsjs.org/docs/controllers
*/
var qs = require('querystring');
var request = require('request');
var jwt = require('jwt-simple');
var moment = require('moment');
@xvitaly
xvitaly / remove_crw.cmd
Last active July 12, 2025 09:00
Remove telemetry updates for Windows 7 and 8.1
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)