#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/usbdevice_fs.h>
This file contains hidden or 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
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - | |
sudo apt-get install -y nodejs |
This file contains hidden or 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
cdp () { | |
TEMP_PWD=`pwd` | |
while ! [ -d .git ]; do | |
cd .. | |
done | |
OLDPWD=$TEMP_PWD | |
} |
This file contains hidden or 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
vim () { | |
last_command=$(history | tail -n 2 | head -n 1) | |
if [[ $last_command =~ 'git grep' ]] && [[ "$*" =~ :[0-9]+:$ ]]; then | |
line_number=$(echo $* | awk -F: '{print $(NF-1)}') | |
/usr/bin/vim +${line_number} ${*%:${line_number}:} | |
else | |
/usr/bin/vim $* | |
fi | |
} |
This file contains hidden or 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
postRequest = function(path, parameters) { | |
var form = $('<form></form>'); | |
form.attr("method", "post"); | |
form.attr("action", path); | |
var addField = function(key, value) { | |
var field = $('<input></input>'); | |
field.attr("type", "hidden"); | |
field.attr("name", key); |
This file contains hidden or 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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
This file contains hidden or 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
$.fn.rotate = function(revolutions, duration) { | |
var deg = 360 * revolutions; | |
this.each(function() { | |
$(this).css({ | |
'-webkit-transform-style': 'preserve-3d', | |
'-o-transform-style': 'preserve-3d', | |
'transform-style': 'preserve-3d', | |
'-webkit-transition': duration + 's ease-in-out', | |
'-o-transition': duration + 's ease-in-out', | |
'transition': duration + 's ease-in-out', |
This file contains hidden or 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
" Vim color file | |
" Original Maintainer: Lars H. Nielsen ([email protected]) | |
" Last Change: 2010-07-23 | |
" | |
" Modified version of wombat for 256-color terminals by | |
" David Liang ([email protected]) | |
" based on version by | |
" Danila Bespalov ([email protected]) | |
set background=dark |
This file contains hidden or 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
" Vim syntax file | |
" Language: PHP 4/5 | |
" Maintainer: Peter Hodge <[email protected]> | |
" Last Change: May 7, 2008 | |
" | |
" URL: http://www.vim.org/scripts/script.php?script_id=1571 | |
" Version: 0.9.7 | |
" | |
" ================================================================ | |
" |
This file contains hidden or 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
backend jsonp_varnish { | |
.host = "localhost"; | |
.port = "80"; | |
} | |
#------------- begin jsonp functionality -------------# | |
# How the jsonp_template_backend dispatches to the ESI generating code: | |
sub jsonp_throw_error_recv { | |
if (req.url == "/JSONP-ESI-TEMPLATE") { | |
error 760; |