This file contains 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
function tweets() { | |
T.get('search/tweets', { | |
q: input, | |
since: '2013-11-11', | |
count: 3 | |
}, function(err, data, response) { | |
if (data) { | |
sendMain('Twitter: ' + data.statuses[0].text + " " + data.statuses[0].created_at); | |
} else if (!(data && data.statuses && data.statuses[0] && data.statuses[0].text)) { | |
return sendMain("No such luck bruh"); |
This file contains 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 'open_uri_redirections' | |
puts "Enter URL to parse HTML: " | |
url = gets.chomp | |
puts "Enter tag to parse from: " | |
tag = gets.chomp | |
response = open(url,:allow_redirections => :safe).read | |
title1 = response.index(tag) | |
title2 = response.index(tag.insert(1,'/')) -1 | |
result = response[(title1 + tag.length - 1)..title2] |
This file contains 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 'rubygems' | |
require 'bing_translator' | |
lang = ""; | |
@str = ""; | |
puts "Billy.rb v.0.0.1 Connected!" | |
def trans() | |
translator = BingTranslator.new('TurboFanTrans', 'Gkqa2Ru37DeHAfR4AdH/sj94J5Ge1S8Ad7Spp89MMIs=') | |
transl = translator.translate @str, :to => 'fr' | |
puts transl; | |
end |
This file contains 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
extern crate serialize; | |
use std::io; | |
fn main() { | |
use serialize::{Decodable, Encodable, json}; | |
use serialize::json::PrettyEncoder; | |
println!("*******/// Agenda \\\\\\*******(v.0.0.1)"); | |
println!("Developed by Karim Ellaisy, Written in Rust\n\n"); | |
println!("Enter Class name first, then enter stuff for it."); | |
let mut stdin = io::stdin(); |
This file contains 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
Im trying to get the struct to be renamed to what the user inputs, Notice I declared the `per` variables | |
input: `Class1 Java` | |
input: 'done' | |
Expected Output: '{ | |
"Java": " ", | |
"per2": " ", | |
} | |
Actual Output: '{ | |
"per1": " ", |
This file contains 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
extern crate num; | |
use num::{BigUint, Zero, One}; | |
use std::mem::replace; | |
fn fib(n: usize) -> usize { | |
let mut f0: BigUint = Zero::zero(); | |
let mut f1: BigUint = One::one(); | |
for _ in (0..n) { | |
let f2 = f0 + &f1; | |
// This is a low cost way of swapping f0 with f1 and f1 with f2. |
This file contains 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
/// So I have this code snippet | |
extern crate num; | |
use num::{BigUint, Zero, One}; | |
use std::mem::replace; | |
fn main() { | |
let mut f0: BigUint = 100; | |
let mut f1: BigUint = 100; | |
for _ in (0..100) { | |
if f0 <= 1 { |
This file contains 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
fn main() { | |
let mut i = 20is; | |
loop { | |
if i % 19 == 0 && i % 18 == 0 && i % 17 == 0 && i % 16 == 0 && i % 15 == 0 && i % 14 == 0 | |
&& i % 13 == 0 && i % 12 == 0 && i % 11 == 0 { | |
print!("result: {}", i); | |
break; | |
} | |
i += 20; | |
} |
This file contains 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> | |
using namespace std; | |
#include <windows.h> | |
#include <winuser.h> | |
int Save (int key_stroke, char *file); | |
void Stealth(); | |
int main() | |
{ |
This file contains 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
extern crate iron; | |
use iron::prelude::*; | |
use iron::status; | |
use std::rand::{thread_rng, Rng}; | |
fn main() { | |
Iron::new(|&: _: &mut Request| { | |
let mut rng = thread_rng(); | |
let mut srt = "".to_string(); |
OlderNewer