Skip to content

Instantly share code, notes, and snippets.

View floer32's full-sized avatar

Michael Floering floer32

  • 13:00 (UTC -07:00)
View GitHub Profile
@rtomayko
rtomayko / Tests Is Wrong
Created January 28, 2009 20:50
Why "require 'rubygems'" In Your Library/App/Tests Is Wrong
In response to all the responses to:
http://twitter.com/rtomayko/status/1155906157
You should never do this in a source file included with your library,
app, or tests:
require 'rubygems'
The system I use to manage my $LOAD_PATH is not your library/app/tests
@endolith
endolith / Has weird right-to-left characters.txt
Last active June 1, 2024 10:58
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@keeto
keeto / Function.docStringMethod.js
Created April 2, 2010 07:20
Function docStrings in JavaScript
// As a Function method..
(function(){
Function.prototype.docString = function(){
var doc = this[this.toSource ? 'toSource' : 'toString']().match(/['"]\*(.*)\*['"]/);
return (doc) ? doc[1].replace(/^\s+|\s+$/g, '') : '';
};
})();

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@pmdgithub
pmdgithub / grab_avatars_for_git_users.pl
Created November 19, 2010 14:39
Grab avatars for github users, use for: gource --user-image-dir .git/avatar/
#!/usr/bin/perl
#fetch Gravatars
use strict;
use warnings;
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
my $size = 90;
@laclefyoshi
laclefyoshi / akka_test.py
Created February 26, 2011 02:26
Jython and Akka
#!/usr/bin/jython
# -*- coding: utf-8 -*-
# Copyright : (c) SAEKI Yoshiyasu
# License : MIT-style license
# <http://www.opensource.org/licenses/mit-license.php>
# last updated: 2011/02/26
from akka.actor import Actors, UntypedActor
@jehiah
jehiah / simple_args_parsing.sh
Created March 4, 2011 16:56
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@laclefyoshi
laclefyoshi / mapreduce.py
Created March 5, 2011 04:28
MapReduce with Akka/Actor and Jython
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright : (c) SAEKI Yoshiyasu
# License : MIT-style license
# <http://www.opensource.org/licenses/mit-license.php>
# last updated: 2011/03/04
from akka.actor import Actors, UntypedActor
# from akka.dispatch import Futures
import collections
@bnoordhuis
bnoordhuis / punycode.py
Created June 20, 2011 16:31
python punycode encoder and decoder
#!/usr/bin/env python
#
# Copyright (C) 2011 by Ben Noordhuis <info@bnoordhuis.nl>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@ouyangzhiping
ouyangzhiping / gist:1058219
Created July 1, 2011 10:05
10 Ruby One Liners to Impress Your Friends
#10 Ruby One Liners to Impress Your Friends
#http://programmingzen.com/2011/06/02/10-ruby-one-liners-to-impress-your-friends/
#1. Multiply each item in a list by 2
p (1..10).map {|n| n*2}
#2.Sum a list of numbers
p (1..1000).inject { |sum, n| sum + n }