Skip to content

Instantly share code, notes, and snippets.

View lumixraku's full-sized avatar
🌴
On vacation

lumix lumixraku

🌴
On vacation
View GitHub Profile
@howardr
howardr / EventManager.js
Created May 27, 2009 14:36
EventManager v1.0.1, an easy custom event manager for javascript
/* EventManager, v1.0.1
*
* Copyright (c) 2009, Howard Rauscher
* Licensed under the MIT License
*/
(function() {
function EventManager() {
this._listeners = {};
@josegonzalez
josegonzalez / .gitconfig
Created September 5, 2010 07:45
My ~/.gitconfig
[user]
name = MY_NAME
email = MY_EMAIL_ADDRESS
[git-tmbundle]
gitnub-path = /Applications/GitNub.app
gitx-path = /Applications/GitX.app
show-diff-check = yes
[github]
user = GITUB_USER
token = GITHUB_TOKEN
@chad3814
chad3814 / gist:2924672
Last active January 16, 2024 20:27
deleting array items in javascript with forEach() and splice()
// This is from my comment here: http://wolfram.kriesing.de/blog/index.php/2008/javascript-remove-element-from-array/comment-page-2#comment-466561
/*
* How to delete items from an Array in JavaScript, an exhaustive guide
*/
// DON'T use the delete operator, it leaves a hole in the array:
var arr = [4, 5, 6];
delete arr[1]; // arr now: [4, undefined, 6]
@catwell
catwell / b64url-np.md
Last active November 27, 2022 21:18
Decoding Base64-URL without padding

Decoding Base64-URL without padding

1) Add padding

Divide the length of the input string by 4, take the remainder. If it is 2, add two = characters at the end. If it is 3, add one = character at the end.

You now have Base64-URL with padding.

2) Translate to Base64

@theY4Kman
theY4Kman / hmac_sha256.py
Created October 15, 2012 16:02
Python SHA-256 HMAC
from Crypto import HMAC, SHA256
def hmac_sha256(key, msg):
hash_obj = HMAC.new(key=key, msg=msg, digestmod=SHA256)
return hash_obj.hexdigest()
@liubin
liubin / cookie.go
Created June 4, 2013 12:44
display cookie in go lang
@fmariluis
fmariluis / config.fish
Created August 22, 2013 19:05
Basic configuration for Fish Shell
set -xg PYTHONPATH /opt/eleccion/ $PYTHONPATH
set -xg PYTHONPATH /opt/operaciones/ $PYTHONPATH
set -xg GOROOT /usr/local/go $GOROOT
set -xg PATH /usr/local/go/bin $PATH
set -xg EDITOR vim $EDITOR
setenv EDITOR vim
function l
ll $argv
@xyqfer
xyqfer / Tween.js
Created October 1, 2013 07:14
缓动算法
/*
* Tween.js
* t: current time(当前时间);
* b: beginning value(初始值);
* c: change in value(变化量);
* d: duration(持续时间)。
* you can visit 'http://easings.net/zh-cn' to get effect
*/
var Tween = {
@fperez
fperez / ProgrammaticNotebook.ipynb
Last active May 2, 2024 19:14
Creating an IPython Notebook programatically
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arielsalminen
arielsalminen / converts-webfont-to-base64.js
Last active August 28, 2020 06:07
Convert Google WOFF font to base64 format and inline to <head> of document
// Get binary file using XMLHttpRequest
function getBinary(file) {
var xhr = new XMLHttpRequest();
xhr.open("GET", file, false);
xhr.overrideMimeType("text/plain; charset=x-user-defined");
xhr.send(null);
return xhr.responseText;
}
// Base64 encode binary string