Skip to content

Instantly share code, notes, and snippets.

View manikrathee's full-sized avatar
🎯
Focusing

Manik Rathee manikrathee

🎯
Focusing
View GitHub Profile
@rsms
rsms / 00 fast-base64_decode.cc
Last active August 11, 2016 16:42
Base64 decoder with constant performance at around 770 MB/s on a 2.8 GHz Intel Core i7 (with clang4.2 -O3 -std=c++11 -DNDEBUG) This gist also includes a 16-byte special-purposed base64 encoder (which can easily be modified to accept variable length input.)
static int base64_decode(unsigned char* dst, size_t dstsize, const char* src, size_t srclen) {
//
// On a 2.8 GHz Intel Core i7 and clang 4.2 -O3 -std=c++11 this was measured to perform well:
// Avg nsec/invocation: 32
// Avg invocations/second: 31 649 841
// Iterations: 10 000 000
// These numbers include C function call overhead (pusing and popping the stack) and are for
// dstsize=16, srclen=22 (tested on decoding a igraph_id). After measuring many different source
// sizes ranging from 16 to 4096, raw performance stays constant (at around 770 MB/s).
//
@dryan
dryan / cloud2campfire
Created August 14, 2013 18:31
CLI to put your latest CloudApp image into Campfire chat
#! /usr/bin/env python
import sys, os, ConfigParser, argparse
from getpass import getpass
CLOUD_CONFIG_PATH = os.path.expanduser('~/.cloudapp')
CAMPFIRE_CONFIG_PATH = os.path.expanduser('~/.basecamp')
def log(message, error_code = None):
if error_code:
#!/usr/bin/env ruby
# *********************************************
# Jekyll Post Generator Awesomeness
# by Cody Krieger (http://codykrieger.com)
# *********************************************
# *********************************************
# Modified by Tim Smith (http://ttimsmith.com)
# Originally created as a command line tool but
@robmiller
robmiller / .gitconfig
Created July 17, 2013 07:52
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@mxub
mxub / Default (OSX).sublime-keymap
Last active July 27, 2019 10:12
A keybinding for Sublime Text 3 that makes SHIFT + SPACE move the cursor one character to the right
[
{ "keys": ["shift+space"], "command": "move", "args": {"by": "characters", "forward": true} }
]
@nrrrdcore
nrrrdcore / index.html
Created June 26, 2013 03:30
Text-Align: Justify; Hack
<p class="month"><span class="name">July</span> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31<span class="break">hi</span></p>
@bastianallgeier
bastianallgeier / project-related-html-tags.html
Last active December 18, 2015 22:58
This is a proposal by @sashtown and @bastianallgeier for the W3C to introduce new, project-related HTML wrapper tags :)
@kingkool68
kingkool68 / Seamless Git Deployment
Last active December 17, 2015 05:09
To push code changes to text servers I do this.
We have a private Git running on a server somewhere which we consider our central repository. Inside the .git/hooks/post-recieve is the following:
#!/bin/bash
while read oldrev newrev ref
do
branch=`echo $ref | cut -d/ -f3`
if [ "master" == "$branch" ]; then
@ThrivingKings
ThrivingKings / Sess-io.js
Last active December 17, 2015 02:09
Using localStorage, Sess-io will check against a stored expiration stamp and force the user to log-out once the session has expired
// Sess-io by @ThrivingKings
// http://thrivingkings.com/read/Sess-iojs-handles-session-expiration-in-pure-JavaScript
// Date fix for good ole IE8
if (!Date.now) {
Date.now = function() {
return new Date().valueOf();
}
}
@dryan
dryan / README.md
Last active December 15, 2015 20:19
Python script for deploying files to S3 with multiple deploy environment support. Moved to http://dryan.github.io/d3ploy.