gitflow | git |
---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/ | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
Check if your Perl stack is vulnerable to the OpenSSL « heartbleed » bug.
curl -s https://gist.githubusercontent.com/dolmen/10096474/raw/ssl-heartbleed-check.pl | perl
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
#these are meant to be run in a REPL, and the java one in beanshell of something of the sort: | |
#ruby | |
[1,2,3,4].select{ |x| x.even? } | |
#python | |
[x for x in [1,2,3,4] if not x%2] | |
#or, more norvingly | |
filter(lambda x: not x%2, [1,2,3,4]) | |
#clojure |
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
# Based on http://blogs.perl.org/users/randy_stauner/2011/06/exploratory-one-liners-with-less-typing.html | |
# and a couple more things which are *really* handy | |
function raptor { | |
case "$1" in | |
-*) break ;; | |
'') | |
echo "Syntax: raptor [-lneEp etc] 'code' | |
The code can make use of: | |
DD() to Data::Dumper::Dumper() a thing, D() to say() it | |
YY() to YAML::Dump() a thing, Y() to say() it |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
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
#!/bin/sh | |
# | |
# some_website - this script starts and stops some_website | |
# | |
# chkconfig: - 85 15 | |
# description: Some website description | |
# pidfile: /var/run/plackup.some_website.pid | |
PID=/var/run/plackup.some_website.pid |
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
// In case we forget to take out console statements. IE becomes very unhappy when we forget. Let's not make IE unhappy | |
if(typeof(console) === 'undefined') { | |
var console = {} | |
console.log = console.error = console.info = console.debug = console.warn = console.trace = console.dir = console.dirxml = console.group = console.groupEnd = console.time = console.timeEnd = console.assert = console.profile = function() {}; | |
} |
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
#!/usr/bin/env perl | |
# parks - spark clone in perl (https://github.com/holman/spark) | |
# Alternatives: https://github.com/holman/spark/wiki/Alternative-Implementations | |
# Wicked Cool Examples: https://github.com/holman/spark/wiki/Wicked-Cool-Usage | |
use List::Util qw( min max ); local $/; | |
my ($t, @n) = ( [qw(▁ ▂ ▃ ▄ ▅ ▆ ▇ █)], -t STDIN ? @ARGV : split ' ', <STDIN> ); | |
print map($t->[ int( ( $_ - min(@n) ) / max(@n) * $#$t ) ], @n), "\n"; |
NewerOlder