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 foo(x) | |
print(2*x) | |
end | |
foo(100) | |
foo = function(x) | |
print(2*x) | |
end | |
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 ruby | |
luarocks_dir = "/Users/mirven/Projects/luarocks/" # ending slash is important for s3sync | |
ARGV.each do |rockspec| | |
rockspec.match(/^(.*).rockspec$/) | |
if $1 | |
`git archive --format=zip --prefix #{$1}/ master >#{$1}.zip` | |
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
Exception in thread "main" java.lang.NoClassDefFoundError: | |
Caused by: java.lang.ClassNotFoundException: | |
at java.net.URLClassLoader$1.run(URLClassLoader.java:200) | |
at java.security.AccessController.doPrivileged(Native Method) | |
at java.net.URLClassLoader.findClass(URLClassLoader.java:188) | |
at java.lang.ClassLoader.loadClass(ClassLoader.java:306) | |
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) | |
at java.lang.ClassLoader.loadClass(ClassLoader.java:251) | |
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) |
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
class IdShortner { | |
static valid_characters = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" | |
static toId(String str) { | |
def i = 0 | |
def num = 0 | |
str.reverse().each { | |
num += valid_characters.indexOf(it) * (int)Math.pow(58, i++) | |
} | |
return num |
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
class Pipe | |
{ | |
public: | |
virtual void Foo() = 0; | |
virtual void Bar() = 0; | |
}; | |
class SerialPipe : public Pipe | |
{ |
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
db.events.group( | |
{ | |
cond : { event : "foo" }, | |
keyf : function(obj) { | |
return { month : obj.timestamp.getMonth()+1, day : obj.timestamp.getDate(), year : obj.timestamp.getYear()+1900 } | |
}, | |
reduce : function(obj,prev) { prev.count++; prev.users[obj.user_id] = 1; }, | |
initial : { count : 0, users : {} }, | |
finalize : function(prev) { | |
var count = 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
[{"name":"Speak","phrase":"It works. Enter 4 digits!"},{"name":"GetDigits","url":"http://resgeniecaller.heroku.com/calls/1","max":4,"method":"post"}] |
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
local stored_functions = {} | |
function create_function(arg_names, body) | |
return function(...) | |
local args = {...} | |
local env = setmetatable({}, { __index = getfenv() }) | |
for index, an in ipairs(arg_names) do | |
env[an] = args[index] | |
end |
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
class Foo | |
end | |
animals = [ "cat", "dog" ] | |
foo = Foo.new | |
m = Module.new | |
m.send(:define_method, :bar) do | |
animals |
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
$ ps aux | grep mysql | |
root 3052 0.0 0.0 3944 608 pts/0 S+ 00:34 0:00 grep mysql | |
root 8327 0.0 0.0 3944 232 ? S 2010 0:00 /bin/sh /usr/bin/mysqld_safe | |
mysql 8366 5.6 2.5 537876 53320 ? Sl 2010 18654:43 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock | |
root 8367 0.0 0.0 3848 392 ? S 2010 0:03 logger -p daemon.err -t mysqld_safe -i -t mysqld | |
root 31379 0.0 0.0 9100 1408 ? Ss Mar21 0:00 /bin/bash /etc/init.d/mysql restart | |
root 31384 0.0 0.0 9136 1468 ? S Mar21 0:00 /bin/bash /etc/init.d/mysql stop | |
root 31403 0.0 0.0 9136 784 ? S Mar21 0:00 /bin/bash /etc/init.d/mysql stop | |
root 31404 0.0 0.0 26716 1960 ? S Mar21 0:00 /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf shutdown |
OlderNewer