View oneliners.scala
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
val factorialOfFive = {1 to 5}.toList.reduceLeft(_*_) |
View glassfish301.rb
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
require 'formula' | |
class Glassfish301 < Formula | |
url 'http://download.java.net/glassfish/3.0.1/release/glassfish-3.0.1.zip' | |
homepage 'http://glassfish.org/' | |
md5 'a24f6ca15bb6b38d4cb2998d607abcde' | |
skip_clean :all | |
def install |
View gist:3155814
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
if (skoupidontenekes_xoris_sakoula()) { | |
try { | |
anazitise_sakoula_skoupidiwn_sthn_porta_ths_kouzinas(); | |
} catch (ksexases_na_psonisis_sakoules_skoupidion) { | |
while (o_geitonas_einai_apo_kato()) { | |
wait(1000); | |
} | |
throw new skoupidi_sto_fotagogo_tou_geitona(); | |
} | |
} else { |
View permutations.lua
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 table = require 'table' | |
function permutations(N) | |
local level, set, co = -1, {}, nil | |
for i = 1, N do set[i] = 0 end | |
co = coroutine.create(function () permute(set, level, N, 1) end) | |
return function () |
View card_shuffle.py
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
import random | |
print [i + 1 for i in random.sample(range(52), 52)] |
View cyclone_ex
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
# to start the server: | |
# pip install twisted | |
# pip install cyclone | |
# cyclone run cyclone_ex.py | |
import cyclone.web | |
from twisted.internet import defer, task, reactor | |
@defer.inlineCallbacks |
View streaming_example.js
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
/* | |
* Streaming example | |
*/ | |
var slice = Array.prototype.slice; | |
/* | |
* All streams respond to certain events | |
*/ |
View Generator Examples.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View ioc.py
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
mport inspect | |
class Container(object): | |
def __init__(self): | |
self.registry = {} | |
def register(self, interface, implementation): | |
self.registry[interface.__name__] = implementation |
View sensei-update-course-completions-for-all-users.php
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
<?php | |
//1. paste this class definition on top of includes/class-sensei-analysis-overview-list-table.php | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
class Sensei_Update_All_User_Course_Completions { |
OlderNewer