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 String | |
| def canonical | |
| mb_chars.strip.normalize(:kd).gsub(/[^\x00-\x7F]/n,'').downcase.to_s | |
| end | |
| def trim | |
| gsub(/ /,'') | |
| 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 Feedzirra | |
| module Parser | |
| class FlickrEntry | |
| include SAXMachine | |
| include FeedEntryUtilities | |
| element :guid, :as => :id | |
| element :link, :as => :url |
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
| export PS1='$( [[ ${?#0} = "" ]] && echo ":) " || echo ":( " )' |
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
| set nocompatible | |
| filetype off | |
| set hlsearch | |
| set tabstop=2 | |
| set shiftwidth=2 | |
| set expandtab | |
| set rtp+=~/.vim/bundle/vundle/ | |
| call vundle#rc() |
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 'net/http' | |
| module LinkOpener | |
| def content_from_link(link) | |
| uri = URI.parse(link) | |
| http = Net::HTTP.new(uri.host, uri.port) | |
| if link =~ /https:/ | |
| http.use_ssl = true | |
| http.verify_mode = OpenSSL::SSL::VERIFY_NONE |
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
| var aVera = true; | |
| var Robot = function(robot) {}; | |
| var RobotState = function (rotateStep) { | |
| data = {}; | |
| data.id = 0; | |
| data.isLookingAtTarget = false; | |
| data.timesShooting = 0; | |
| data.rotateStep = rotateStep; |
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
| var aVera = true; | |
| var Robot = function(robot) {}; | |
| var RobotState = function (rotateStep) { | |
| data = {}; | |
| data.id = 0; | |
| data.isLookingAtTarget = false; | |
| data.timesShooting = 0; | |
| data.rotateStep = rotateStep; |
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
| all_characters = [('a'..'z'), ('A'..'Z'), (0..9)].map { |i| i.to_a }.flatten | |
| secret = (0...100).map { all_characters[rand(all_characters.length)] }.join | |
| puts secret |
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
| gem 'eb_deployer' |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
OlderNewer