This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var φ = 1.618033988749895, | |
ρ = 180 / Math.PI; | |
var vertices = [ | |
[1,φ,0], [-1,φ,0], [1,-φ,0], [-1,-φ,0], | |
[0,1,φ], [0,-1,φ], [0,1,-φ], [0,-1,-φ], | |
[φ,0,1], [-φ,0,1], [φ,0,-1], [-φ,0,-1] | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handlebars.registerHelper('linkify', function (text) { | |
text = text.replace(/(https?:\/\/\S+)/gi, function (s) { | |
return '<a href="' + s + '">' + s + '</a>'; | |
}); | |
text = text.replace(/(^|)@(\w+)/gi, function (s) { | |
return '<a href="http://twitter.com/' + s + '">' + s + '</a>'; | |
}); | |
text = text.replace(/(^|)#(\w+)/gi, function (s) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pwd | |
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh | |
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc | |
chsh -s /bin/zsh | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bash alias | |
alias subl='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl' | |
# bash function, usage: $ st -p [projectname] -opt2 -opt3 | |
function st() { | |
if [ -n "$1" -a -n "$2" ]; then # if more than one argument | |
if [ "$1" = "-p" -o "$1" = "--project" ]; then # if arg1 is -p or --project | |
local projectfile="$2" | |
[[ $projectfile != *.sublime-project ]] && projectfile="$2.sublime-project" # detect if arg2 already includes the ext | |
if [ -e $projectfile ]; then # does project file exist? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webviewProvider = (function() { | |
if (/\/FBIOS/i.test(navigator.userAgent) === true) { | |
return 'facebook'; | |
} | |
if (/Twitter for/i.test(navigator.userAgent) === true) { | |
return 'twitter'; | |
} | |
if (/Pinterest\//.test(navigator.userAgent) === true) { | |
return 'pinterest'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// very simple version of $X | |
// $X(exp); | |
// $X(exp, context, resolver, XPathResult.NUMBER_TYPE).numberValue; | |
// @source https:/raw.github.com/gist/29681 | |
function $X (exp, context, resolver, result_type) { | |
context || (context = document); | |
var Doc = context.ownerDocument || context; | |
var result = Doc.evaluate(exp, context, resolver, result_type || XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
if (result_type) return result; | |
for (var i = 0, len = result.snapshotLength, res = new Array(len); i < len; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Referral: your mom | |
// @namespace yourmom | |
// @description This script changes every utm_source variable in links to 'Your mom'. | |
// @include * | |
// ==/UserScript== | |
var links = document.getElementsByTagName('a'); | |
for(var i=0; i<links.length; i++) { | |
links[i].href = links[i].href.replace(/([&|?])utm_source=(.*)([&|?|^])/,"$1utm_source=Your+mom$3"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You appear to be advocating a new: | |
[ ] cloud-hosted [ ] locally installable [ ] web-based [ ] browser-based [ ] language-agnostic | |
[ ] language-specific IDE. Your IDE will not succeed. Here is why it will not succeed. | |
You appear to believe that: | |
[ ] Syntax highlighting is what makes programming difficult | |
[ ] Garbage collection is free | |
[ ] Computers have infinite memory | |
[ ] Nobody really needs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* ContentAwareImage | |
* | |
* @author stig | |
*/ | |
class ContentAwareImage { | |
protected static $start_time = 0.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# original post: https://rentry.org/sd-loopback-wave | |
# original author: https://rentry.org/AnimAnon | |
import os | |
import platform | |
import numpy as np | |
from tqdm import trange | |
import math | |
import subprocess as sp | |
import string | |
import random |
OlderNewer