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 | |
| # Script to watch a directory for any changes to a haml file | |
| # and compile it. | |
| # | |
| # USAGE: ruby haml_watch.rb <directory_to_watch> [output_directory] | |
| # | |
| # Blake Smith / http://blakesmith.github.com/2010/09/05/haml-directory-watcher.html | |
| # | |
| require 'rubygems' |
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
| # inline coffeescript for haml with on-the-fly compilation | |
| # run this script in the directory of your project | |
| require 'fssm' | |
| #required for using inline :coffee tag with HAML- | |
| require 'coffee-filter' | |
| directory = File.dirname(__FILE__) | |
| FSSM.monitor(directory, '**/*') do | |
| update do |base, relative| |
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 'rest_client' | |
| require 'json' | |
| #Initialization: Load the words into a usable format from the API. | |
| #These are the only settings you would need to change if you were a different user: | |
| #Goto: https://www.lingq.com/accounts/apikey/ to find your API Key | |
| api_key = 'YOUR API KEY GOES HERE. CHANGE THIS!' | |
| lang_code = 'ko' #for Korean, en for English, etc. | |
| #The voice to use for your target language |
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
| #include <iostream> | |
| #include <fstream> | |
| #include <string> | |
| #include <sstream> | |
| #include <map> | |
| using namespace std; | |
| ifstream readStream; | |
| string tempString; |
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
| text = ' ' | |
| line_count = 0 | |
| File.open("text.txt").each do |line| | |
| line_count += 1 | |
| text << line | |
| end | |
| puts "#{line_count} lines" | |
| total_characters = text.length | |
| puts "#{total_characters} characters" | |
| total_characters_nospaces = text.gsub(/\s+/, ' ').length |
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
| <div class="container"> | |
| <h1>Hello</h1> | |
| <p> <strong>Status:</strong><div class="status"> Not ready. </div></p> | |
| <p> <strong>Note:</strong> Lorem epson dolorm epset.</p> | |
| <div class="row"> | |
| <form> | |
| <input class='input' name='waypoint' value='name'><br/> | |
| <input class='input lat' name='lat' type='text' value='1'><br/> | |
| <input class='input lng' name='lng' type='text' value='1'><br/> | |
| </form> |
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 'sinatra' | |
| require 'shotgun' | |
| get '/' do | |
| # Did you put this in the '/views/' directory?? | |
| erb :form | |
| end | |
| post '/form' do | |
| lines = params[:message] |
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 Something | |
| constructor: -> | |
| @delegateObject = new Messager | |
| class Messager | |
| testing: (int) -> | |
| console.log int | |
| woot: (bool) -> | |
| console.log bool | |
| nothing: (array) -> |
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 Compass | |
| constructor: (options = {enableHighAccuracy: yes, maximumAge: 10000, timeout: 100000}) -> | |
| @lat = 0 | |
| @lng = 0 | |
| @alt = 0 | |
| @acc = 0 | |
| @altAcc = 0 | |
| @hdg = 0 | |
| @spd = 0 | |
| @_grabGPS(options) |
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
| encryption = (plain_text, key) -> | |
| # Note: plain_text and key must be the same length | |
| return if plain_text.length != > key.length | |
| a = [] | |
| b = [] | |
| c = [] | |
| d = [] | |
| for char in w1 |
OlderNewer