Skip to content

Instantly share code, notes, and snippets.

🚲
Inventing

Alexey Novikov velocityzen

🚲
Inventing
Block or report user

Report or block velocityzen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nossidge
nossidge / Snowball
Last active Dec 15, 2015
C++ Generate valid snowball poems, using input file of example text and Markov chains to help make it grammatically correct.
View Snowball
/*
~~ Snowball Poem ~~
Snowball (also called a Chaterism): A poem in which each line is a single word,
and each successive word is one letter longer. One of the constrained writing
techniques invented by the Oulipo (Workshop of Potential Literature).
~~ Program Description ~~
This program takes input from the file "input-raw.txt". It examines the file for
@LinusU
LinusU / uuid-v5.js
Created Apr 30, 2014
UUID V5 Node.js
View uuid-v5.js
function uuid5(data) {
var out = crypto.createHash('sha1').update(data).digest();
out[8] = out[8] & 0x3f | 0xa0; // set variant
out[6] = out[6] & 0x0f | 0x50; // set version
var hex = out.toString('hex', 0, 16);
return [
hex.substring( 0, 8),
@RTC1
RTC1 / gist:89d7f95555be8cf7d1aa
Created Jun 27, 2014
CacheBuster NGINX Rule 1
View gist:89d7f95555be8cf7d1aa
location ~* "^(.+)-[0-9a-f]{32}(\.(.*))$" {
try_files $uri $1$2 =404;
}
@renehuber
renehuber / gist:2959472
Created Jun 20, 2012
Plaintext contentEditable DIVs
View gist:2959472
/**
* Event handler to prevent richtext and linebreaks in contentEditable DIVs
*/
$('body').on('keydown paste', 'div.editfield', function(e) {
var $field = $(e.currentTarget);
if (e.keyCode===13 && $field.hasClass('multiline')) {
return true;
} else if (e.keyCode===13 || e.type==='paste') {
setTimeout(function() {
$field.html($field.text());
@eriwen
eriwen / cors.js
Created May 26, 2012
Simple cross-domain Javascript function
View cors.js
/**
* Make a X-Domain request to url and callback.
*
* @param url {String}
* @param method {String} HTTP verb ('GET', 'POST', 'DELETE', etc.)
* @param data {String} request body
* @param callback {Function} to callback on completion
* @param errback {Function} to callback on error
*/
function xdr(url, method, data, callback, errback) {
@b2arn
b2arn / puller
Created Aug 13, 2012
Script to git pull all repos in directory
View puller
#!/bin/bash
current_dir=`pwd`/
dir=$current_dir
usage="Usage : `basename $0` [-d dir] [-h] args\nWhere args are directories that you don't whant to pull"
while getopts hd: opt; do
case $opt in
d)
if [ ! -d "$OPTARG" ] ; then
View deepdream-install.md
#!/usr/bin/env bash

# Assuming OS X Yosemite 10.10.4

# Install XCode and command line tools
# See https://itunes.apple.com/us/app/xcode/id497799835?mt=12#
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html
xcode-select --install
View TBezierInterpolation.cpp
#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
#define EPSILON 1.0e-5
#define RESOLUTION 32
class Point2D
@bendc
bendc / iterable.js
Created Jan 26, 2016
Make objects iterable
View iterable.js
const iterable = function* (obj) {
yield* Object.keys(obj).map(key => [key, obj[key]]);
};
@softdetours
softdetours / seeyouspacecowboy.sh
Last active Sep 22, 2019
A shell script to display SEE YOU SPACE COWBOY whenever you logout of your terminal!
View seeyouspacecowboy.sh
#!/usr/bin/env bash
# SEE YOU SPACE COWBOY by D.K. REHN (softdetours.com)
# Displays a timeless message in your terminal with cosmic color effects
# Usage: add "sh ~/seeyouspacecowboy.sh; sleep 2" to .bash_logout (or similar) in your home directory
# (adjust the sleep variable to display the message for more seconds)
# Cosmic color sequence
You can’t perform that action at this time.