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 Event | |
| include MongoMapper::Document | |
| plugin MultiParameterAttributes | |
| key :name, String, :required => true | |
| key :start_date, Date, :required => true | |
| key :start_time, Time, :required => true | |
| 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
| module Noodall | |
| module Search | |
| STOPWORDS = ["about", "above", "above", "across", "after", "afterwards", "again", "against", "all", "almost", "alone", "along", "already", "also", "although", "always", "among", "amongst", "amoungst", "amount", "and", "another", "any", "anyhow", "anyone", "anything", "anyway", "anywhere", "are", "around", "back", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "bill", "both", "bottom", "but", "call", "can", "cannot", "cant", "con", "could", "couldnt", "cry", "describe", "detail", "done", "down", "due", "during", "each", "eight", "either", "eleven", "else", "elsewhere", "empty", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except", "few", "fifteen", "fify", "fill", "find", "fire", "first", "five", "for", "former", "formerly", "forty", "found", "four", "from", "front", "full", "further", "get", "give", "had", "has", "hasnt", "have", |
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 'mongo_mapper' | |
| class Yester | |
| include MongoMapper::Document | |
| key :name, String | |
| alias_attribute :foo, :name | |
| alias_method :bar, :name | |
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 'httparty' | |
| require 'will_paginate/collection' | |
| require 'ostruct' | |
| class GoogleCustomSearch | |
| include HTTParty | |
| base_uri 'https://www.googleapis.com/customsearch/v1' | |
| format :json | |
| default_params :cx => 'google-costom-searck-id', :key => 'google-api-key' |
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
| puts "\n=========================================================" | |
| puts " Noodall TEMPLATE" | |
| puts "\n=========================================================" | |
| require "rails" | |
| require "net/http" | |
| require "net/https" | |
| # Copy a static file from the template into the new application | |
| def copy_static_file(path) |
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
| #!/usr/bin/env ruby | |
| # Changed bit of code toggling mute - was throwing errors for me. | |
| # Added output, so it could be piped to a notify-osd or somesuch if desired. | |
| # Pulseaudio volume control | |
| class Pulse | |
| attr_reader :volumes, :mutes | |
| # Constructor |
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
| c = Capybara::Node::Simple.new '<p>Hi <a href="/test">there</a> people</p>' | |
| c.find('a:contains("there")')[:href] # => "/test" |
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
| if exists('$TMUX') | |
| " Prompt for a command to run | |
| map <Leader>vp :VimuxPromptCommand<CR> | |
| " Run last command executed by VimuxRunCommand | |
| map <Leader>vl :VimuxRunLastCommand<CR> | |
| " Inspect runner pane | |
| map <Leader>vi :VimuxInspectRunner<CR> |
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
| # Example from http://mikepackdev.com/blog_posts/31-exhibit-vs-presenter | |
| class Decorator < SimpleDelegator | |
| end | |
| class Car | |
| def price | |
| 1_000_000 | |
| 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
| #!/bin/bash | |
| play() { | |
| playlist="http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_$1.m3u8" | |
| echo $playlist | |
| if mpc | |
| then | |
| mpc add $playlist | |
| mpc play | |
| else | |
| mplayer $playlist |
OlderNewer