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 'cleverbot' | |
| @client1 = Cleverbot::Client.new | |
| @client2 = Cleverbot::Client.new | |
| def say message, voice="Vicki" | |
| puts message | |
| `say -v #{voice} "#{message}"` | |
| 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
| use Rack::Static, | |
| :urls => ["/images", "/js", "/css", "/public"], | |
| :root => "public" | |
| require './webserver.rb' | |
| run KoderWSApp.new |
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
| # Update APT package index | |
| sudo apt-get update | |
| # Install prerequisites | |
| sudo apt-get install -y git curl zlib1g-dev subversion | |
| sudo apt-get install -y openssl libreadline6-dev git-core zlib1g libssl-dev | |
| sudo apt-get install -y libyaml-dev libsqlite3-dev sqlite3 | |
| sudo apt-get install -y libxml2-dev libxslt-dev | |
| sudo apt-get install -y autoconf automake libtool bison |
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 <stdio.h> | |
| #include <stdlib.h> | |
| /*3.6. De pe mediul de intrare se citeşte un număr natural n. Să se | |
| verifice dacă numărul respectiv este palindrom. | |
| */ | |
| int main() | |
| { | |
| int n,ninv,aux; | |
| printf("introduceti numarul: "); | |
| scanf("%d",&n); |
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 'open-uri' | |
| require 'nokogiri' | |
| require 'json' | |
| def search word | |
| open("http://www.dict.cc/?s=#{word}").read | |
| end | |
| keyword = ARGV.count > 0 ? ARGV.join(" ") : "stein" |
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 | |
| clipboard = `pbpaste` | |
| begin | |
| output = eval(clipboard) | |
| `echo #{output} | pbcopy` | |
| rescue Exception => e | |
| # silence exception | |
| 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
| #import <Foundation/Foundation.h> | |
| @interface NSURLRequest (cURL) | |
| - (NSString *)cURLCommand; | |
| @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
| DERIVED_DATA_PATH = "~/Library/Developer/Xcode/DerivedData/" | |
| def projects | |
| `ls -al #{DERIVED_DATA_PATH}`.split("\n")[3..-1].map { |p| | |
| ls_components = p.split(" ") | |
| project_name = ls_components.last | |
| if project_name != "ModuleCache" | |
| project_name = project_name.split("-")[0..-2].join("-") | |
| else |
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
| // Invalidate a call if it's been less that 1 second since the last one | |
| //===================================================================== | |
| static NSDate *lastDate = nil; | |
| NSDate *currentDate = [NSDate date]; | |
| if (lastDate != nil && | |
| [currentDate timeIntervalSinceDate:lastDate] < 1) { | |
| return ; | |
| } | |
| lastDate = currentDate; | |
| //===================================================================== |
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 | |
| clipboard = `pbpaste` | |
| if clipboard.match /https?:\/\/w?w?w?\.((youtube)|(listenonrepeat))\.com\/.*/ | |
| # Youtube / Listen on repeat | |
| if clipboard["youtube"] != nil | |
| clipboard["youtube"] = "listenonrepeat" | |
| elsif clipboard["listenonrepeat"] != nil | |
| clipboard["listenonrepeat"] = "youtube" | |
| end |