Skip to content

Instantly share code, notes, and snippets.

View jdelStrother's full-sized avatar
👋

Jonathan del Strother jdelStrother

👋
View GitHub Profile
RSpec.configure do |config|
no_transactions = lambda do |example|
self.use_transactional_fixtures = false
DatabaseCleaner.start
example.run
DatabaseCleaner.clean
end
config.around(:type=>:feature, &no_transactions)
x = "میثم آز ربنا"
words = x.split(" ")
crazy = words.map{|x| "-- #{x} ++"}
puts crazy.inspect
#=> ["-- میثم ++", "-- آز ++", "-- ربنا ++"]
try_files $uri @app;
location @app {
# if the host looks like api.<something>/<somepath> then rewrite the request
# as /api/<somepath>
if ( $host ~* api\.(.*) && $path !~ ^/api) {
rewrite ^(.*)$ /api$1 last;
}
include "proxy.conf";
proxy_pass http://backend_app;
<?php
include_once "../../library/OAuthStore.php";
include_once "../../library/OAuthRequester.php";
$consumer_key = "06b4c02d1aa1cb98562264c1";
$consumer_secret = "0334a90b23ee15b9d05859f21d6759169dd6758512ea852e8e7fb673b583c581";
$host = "http://api.audioboo.fm";
$options = array(
<html>
....
<body>
<%= render(@header_template||'layouts/header') %>
</body>
</html>
.header {
width: 100%;
}
body.product .header {
width: 200px;
border: 20px solid pink;
}
hash = {x: {y: 2, z:{qw:1, rt:e}}, a:1, b:2}
deep_3_finder = ->((k,v)){ v.is_a?(Hash) ? v.any?(&deep_3_finder) : v==3 }
hash.any?(&deep_3_finder)
@jdelStrother
jdelStrother / gist:5518202
Created May 4, 2013 17:46
Uninstalling nanofibre daemon - open Terminal.app and run :
launchctl unload ~/Library/LaunchAgents/Nanofibre.plist
rm ~/Library/LaunchAgents/Nanofibre.plist
sudo rm /usr/local/bin/fibred