This file contains hidden or 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
# Use as: sass -r ./bust_url.rb | |
require 'digest/md5' | |
module Sass::Script::Functions | |
def bust_url(url) | |
url = url.value | |
source = options[:filename] | |
dir = File.dirname(source) | |
file = File.join(dir, url) |
This file contains hidden or 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 loadScript(path, fn) { | |
var el = document.createElement('script') | |
, loaded = 0 | |
, onreadystatechange = 'onreadystatechange' | |
, readyState = 'readyState'; | |
el.onload = el.onerror = el[onreadystatechange] = function () { | |
if (loaded || (el[readyState] && !(/^c|loade/.test(el[readyState])))) return; | |
el.onload = el.onerror = el[onreadystatechange] = null; | |
loaded = 1; |
This file contains hidden or 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
a=b=c=(1..100).each do |num| | |
print num, ?\r, | |
("Fizz" unless (a = !a) .. (a = !a)), | |
("Buzz" unless (b = !b) ... !((c = !c) .. (c = !c))), | |
?\n | |
end |
This file contains hidden or 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 Symbol | |
def | other | |
-> arg { other.to_proc[arg.send(self)] } | |
end | |
def call(*args) | |
-> arg { arg.send(self, *args) } | |
end | |
end |
This file contains hidden or 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
Some free books from Amazon, some blog posts, some textbooks, some poetry. | |
Wool | |
Howey, Hugh | |
Liars and Outliers: Enabling the Trust that Society Needs to Thrive | |
Schneier, Bruce | |
Brainstorming Doesn’t Really Work : The New Yorker |
This file contains hidden or 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
; Printing stuff to the screen | |
; by Markus Persson | |
#macro clear(color) { | |
push(a) | |
set a, color | |
shl a, 8 | |
bor a, 0x20 | |
mem_fill(0x8000, 0x180, a) | |
set [screen_p], 0 |
This file contains hidden or 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 Register < Struct.new(:name) | |
BASIC = %w[A B C X Y Z I J].map(&:to_sym) | |
SPECIAL = %w[POP PEEK PUSH SP PC O].map(&:to_sym) | |
ALL = BASIC + SPECIAL | |
attr_accessor :plus | |
def value | |
case name | |
when *BASIC |
This file contains hidden or 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
# Place this in test/ | |
# | |
# Run your tests with: | |
# | |
# prove -e 'ruby -Ilib:test' -v t/*.rb | |
# | |
# See the bottom for usage. | |
require 'minitest/unit' |
This file contains hidden or 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 'ffi' | |
class Object | |
def memory_location | |
object_id * 2 | |
end | |
def to_pointer | |
FFI::Pointer.new(memory_location) | |
end |
This file contains hidden or 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
diff --git a/ci_environment/perlbrew/attributes/default.rb b/ci_environment/perlbrew/attributes/default.rb | |
new file mode 100644 | |
index 0000000..e69de29 | |
diff --git a/ci_environment/perlbrew/attributes/multi.rb b/ci_environment/perlbrew/attributes/multi.rb | |
new file mode 100644 | |
index 0000000..2c9dad4 | |
--- /dev/null | |
+++ b/ci_environment/perlbrew/attributes/multi.rb | |
@@ -0,0 +1,5 @@ | |
+default[:perlbrew][:notests] = true |