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
| Run options: | |
| # Running tests: | |
| .. | |
| Finished tests in 0.000774s, 2583.9793 tests/s, 2583.9793 assertions/s. | |
| 2 tests, 2 assertions, 0 failures, 0 errors, 0 skips |
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
| app = FbGraph::Application.new(APP_ID) | |
| me = FbGraph::User.me(ACCESS_TOKEN) | |
| ## Play (pre-configured for Game apps) | |
| # Fetch activities | |
| actions = me.og_actions "games.plays" | |
| # Publish an activity |
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
| # the only dependencies are http://rubygems.org/gems/transitions | |
| # and I think active support | |
| module Search | |
| module QueryBuilderHelper | |
| def sanitize_field_for_solr_query(query) | |
| if query.is_a?(Hash) | |
| query.inject({}) do |result, query_component| | |
| result[query_component.first] = query_component.first == '*' ? query_component.last : QueryField.sanitize(query_component.last) | |
| result |
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
| # The latest version of this script is now available at | |
| # https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh | |
| VERSION=1.9.3-p286 | |
| brew update | |
| brew install rbenv ruby-build rbenv-vars readline ctags | |
| if [ -n "${ZSH_VERSION:-}" ]; then | |
| echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc | |
| else | |
| echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile |
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
| cd ~ | |
| sudo apt-get update | |
| sudo apt-get install unzip curl python-software-properties -y | |
| #sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" | |
| sudo add-apt-repository ppa:ferramroberto/java | |
| sudo apt-get update | |
| sudo apt-get install sun-java6-jre sun-java6-plugin -y | |
| wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.7.tar.gz -O elasticsearch.tar.gz | |
| tar -xf elasticsearch.tar.gz |
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
| mysql> select * from obscenity; | |
| +----------------+ | |
| | phrase | | |
| +----------------+ | |
| | arse | | |
| | arsehole | | |
| | asshole | | |
| | autopooch | | |
| | autopooched | | |
| | bastard | |
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
| sudo apt-get install unzip | |
| wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.4.zip | |
| unzip elasticsearch-0.17.4.zip | |
| sudo apt-get install python-software-properties | |
| sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" | |
| sudo apt-get update | |
| sudo apt-get install sun-java6-jre sun-java6-plugin | |
| sudo mv elasticsearch-0.17.4 /usr/local/share | |
| cd elasticsearch-servicewrapper | |
| sudo mv service /usr/local/share/elasticsearch-0.17.4/bin |
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
| /* http://meyerweb.com/eric/tools/css/reset/ | |
| v2.0 | 20110126 | |
| License: none (public domain) | |
| */ | |
| html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { | |
| margin: 0; | |
| padding: 0; | |
| border: 0; | |
| font-size: 100%; |
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
| +search(:users, "action:remove") do |rm_user| | |
| + user rm_user['id'] do | |
| + action :remove | |
| + end | |
| +end | |
| sysadmin_group = Array.new | |
| -search(:users, 'groups:sysadmin') do |u| | |
| +search(:users, 'groups:sysadmin NOT action:remove') do |u| |
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
| # creates a global JST object containing all the templates | |
| # 1. install Tilt in your Gemspec | |
| # 2. Paste this in a file at app/assets/javascripts/templates.js.coffee.erb | |
| # 3. `require` the templates file from your main js include file. | |
| # 4. Put your templates at app/views/whatever/my_template.html.jst | |
| window.JST = | |
| <% Dir[Rails.root.join('app/views/**/*.jst')].each do |path| %> | |
| <%= path.match(%r{/([^/]+)\.html\.jst$})[1] %>: _.template(<%= File.read(path).inspect.gsub(/\r?\n/, '') %>) | |
| <% end %> |