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
Test |
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
/* Ruby Thread support: | |
Ruby implements threads by using setjmp/longjmp to switch between separate | |
C stacks within one native thread. | |
This confuses Objective C because NSThread stores a per-native-thread stack | |
of autorelease pools and exception handlers. When the C stack changes, an | |
error message like this is likely to appear: | |
Exception handlers were not properly removed. Some code has jumped or |
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/ruby | |
require 'osx/cocoa' | |
include OSX | |
class Foo < NSObject | |
def applicationDidFinishLaunching(sender) | |
puts "yo" | |
end | |
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
diff --git a/Brocfile.js b/Brocfile.js | |
index 7fa2af9..3718742 100644 | |
--- a/Brocfile.js | |
+++ b/Brocfile.js | |
@@ -1,6 +1,9 @@ | |
/* global require, module */ | |
var EmberApp = require('ember-cli/lib/broccoli/ember-app'); | |
+var ES6Modules = require('broccoli-es6modules'); | |
+var esTranspiler = require('broccoli-babel-transpiler'); |
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
defmodule AuthController do | |
# ... | |
def index(conn, _params) do | |
#... | |
twitter_client(conn).do_something | |
#... | |
end | |
# Allow replacing the module used to call twitter. This is used in tests to | |
# stub out the external service |
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
defmodule Sheep.PageController do | |
use Sheep.Web, :controller | |
alias Sheep.Repo | |
alias Sheep.MailingListAddress | |
def index(conn, _params) do | |
render conn, "index.html" | |
end | |
def new_email(conn, params) do |
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
defmodule Sheep.PageController do | |
use Sheep.Web, :controller | |
alias Sheep.Repo | |
alias Sheep.MailingListAddress | |
def index(conn, _params) do | |
render conn, "index.html" | |
end | |
def new_email(conn, params) do |
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
# in ~/.irbrc | |
if ENV['RAILS_ENV'] | |
load '~/.railsrc' | |
end | |
# in ~/.railsrc | |
def sql(query) | |
ActiveRecord::Base.connection.select_all(query) | |
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
export LSCOLORS=gxfxcxdxbxegedabagacad | |
if [[ $OS == 'Linux' ]]; then | |
alias ls='ls --color=auto' | |
else | |
alias ls='ls -G' | |
fi | |
alias ll='ls -l' | |
alias lls='ll -S' | |
alias lt='ll -t' | |
alias ltr='ls -ltr' |
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 -w | |
#--- | |
# Excerpted from "TextMate" | |
# We make no guarantees that this code is fit for any purpose. | |
# Visit http://www.pragmaticprogrammer.com/titles/textmate for more book information. | |
#--- | |
$LOAD_PATH << "#{ENV["TM_SUPPORT_PATH"]}/lib" | |
require "exit_codes" | |
require "web_preview" |
OlderNewer