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
defmodule HeroiconWithSurface do | |
@moduledoc """ | |
This assumes https://github.com/tailwindlabs/heroicons has been cloned as a submodule to svgs/heroicons | |
Examples: | |
<#HeroiconWithSurface variant="outline" icon="phone" class="w-5 h-5" /> | |
<%= HeroiconWithSurface.svg({"outline", "phone"}, class: "w-5 h-5") %> | |
""" | |
use SvgIcons, |
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
#!/bin/bash | |
SD=$(dirname $(realpath "$0")) || exit 1 | |
[ `arch` = 'x86_64' ] && url='https://julialang.s3.amazonaws.com/bin/linux/x64/0.5/julia-0.5.2-linux-x86_64.tar.gz' \ | |
|| url='https://julialang.s3.amazonaws.com/bin/linux/x86/0.5/julia-0.5.2-linux-i686.tar.gz' | |
echo $url | |
tmpd="$SD/tmp" |
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
Mustache.to_javascript("Hello {{planet}}") |
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 MyView < Mustache | |
def cache_by_user_id | |
lambda do |text| | |
cache_key = "user:#{current_user.id}" | |
if value = $cache.get(cache_key) | |
value | |
else | |
rendered = render(text) | |
$cache.set(cache_key, rendered) |
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
rvm install 1.8.7 --debug -C --with-readline-dir=$HOME/.rvm/usr,--with-iconv-dir=$HOME/.rvm/usr,--enable-shared | |
rvm 1.8.7 | |
wget http://downloads.sourceforge.net/project/rubycocoa/RubyCocoa/1.0.1/RubyCocoa-1.0.1.tar.gz?use_mirror=superb-sea2 | |
tar zxf RubyCocoa-1.0.1.tar.gz | |
cd RubyCocoa-1.0.1 | |
ruby install.rb config --target-archs=x86_64 | |
ruby install.rb setup | |
rvmsudo ruby install.rb install | |
gem install xrefresh-server |

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 'spec/runner/formatter/progress_bar_formatter' | |
# Put this in spec/support and run with: | |
# spec spec --require spec/support/no_shoulds_punk_formatter.rb --format NoShouldsPunkFormatter | |
class NoShouldsPunkFormatter < Spec::Runner::Formatter::ProgressBarFormatter | |
def initialize(options, output) | |
super | |
@examples_with_should = [] |
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 'webrick' | |
require 'webrick/httpproxy' | |
require 'fileutils' | |
require 'md5' | |
### | |
# FakeWebRecorder is an HTTP Proxy that records sessions as calls to FakeWeb. | |
# The code that FakeWebRecorder generates should be suitable for testing | |
# interaction with a particular website. | |
# |
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
When /^(.*) in the "([^\"]*)" section$/ do |action, title| | |
within "//*[(h1|h2|h3|h4|h5|h6|legend|caption)/descendant-or-self::*[contains(text(), '#{title}')]]" do | |
When action | |
end | |
end | |
When /^(.*) in the "([^\"]*)" row$/ do |action, title| | |
within "//*[(th|td)/descendant-or-self::*[contains(text(), '#{title}')]]" do | |
When action | |
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
require 'strscan' | |
require 'set' | |
class SqlQuery < Struct.new(:table, :where, :order) | |
def to_json | |
[table, where, order].to_json | |
end | |
end | |
class SqlScanner |
NewerOlder