Skip to content

Instantly share code, notes, and snippets.

View ironcamel's full-sized avatar

Naveed Massjouni ironcamel

  • Blacksburg, VA, USA
View GitHub Profile
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 3, 2024 12:32
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

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.

Possible solutions

@p01
p01 / LICENSE.txt
Last active March 9, 2024 13:40 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
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
@dolmen
dolmen / README.md
Last active December 30, 2023 10:25
Check if your Perl 5 stack is vulnerable to the OpenSSL heartbleed bug

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
@lfborjas
lfborjas / gist:817504
Created February 8, 2011 23:12
Filter even numbers in a list; fork it for maximum fun!
#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
@mfontani
mfontani / raptor.sh
Created June 23, 2011 13:10
raptor -- type less to do more with a Perl one-liner
# 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
@throughnothing
throughnothing / pr.md
Created October 29, 2012 16:51 — forked from piscisaureus/pr.md
Checkout github pull requests locally

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:

@mvickers
mvickers / some_website
Created October 20, 2011 05:05
Basic Centos init script for Dancer apps
#!/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
@mjangda
mjangda / console-error.js
Created April 29, 2010 19:37
Protects you from console.log() errors for your IE and Firebug-less Firefox users.
// 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() {};
}
@throughnothing
throughnothing / parks.pl
Created April 30, 2012 03:50
spark clone in perl
#!/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";