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
#!usr/bin/python | |
import sys | |
import urllib | |
from bs4 import BeautifulSoup as BS | |
if len(sys.argv) != 2: | |
print "Usage: %s thread_url"%(sys.argv[0]) | |
sys.exit() | |
soup=BS(urllib.urlopen(sys.argv[1]).read()) | |
for link in soup.find_all("p", class_="fileinfo"): | |
src = "https://lainchan.org"+link.find_next("a")['href'].encode("UTF-8") |
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
if(@ARGV < 1){ | |
print "Usage $0 filename1 filename2\n"; | |
exit(1); | |
} | |
foreach (@ARGV){ | |
my $file = `cat $_`; | |
my $r = `curl -s -X POST -d "$file" http://hastebin.com/documents`; | |
if($r =~ /\{"key":"(.*?)"\}/){ | |
print "$_ : http://hastebin.com/$1\n"; | |
} |
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
import readline | |
import subprocess | |
import urllib | |
import urllib2 | |
from sys import exit | |
from bs4 import BeautifulSoup as bs | |
def get_titles(): | |
soup = bs((urllib2.urlopen("https://animetwist.net"))) | |
titles = [t.text.replace(" ","_") for t in soup.select("li a") if t.text != "ONGOING"] |
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
import java.util.stream.IntStream; | |
public class FizzBuzz { | |
public static void main(String[] args) { | |
IntStream.range(1,101).forEach(i->{ | |
String result = (i % 15 == 0) ? "FizzBuzz": | |
(i % 3 == 0) ? "Fizz" : | |
(i % 5 == 0) ? "Buzz" : | |
Integer.toString(i); | |
System.out.println(result); | |
}); |
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
import java.util.stream.IntStream; | |
public class ProjectOne{ | |
public static void main(String[] args){ | |
System.out.println(IntStream.range(1, 1000).filter(n -> n % 3 == 0 || n % 5 == 0).sum()); | |
} | |
} |
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
title=$( curl 'http://pomf.se' -so - | grep -iPo '(?<=<title>)(.*)(?=</title>)') | |
[ "$title" == "Pomf will be back shortly" ] && notify-send "Pomf is down" ":c" || notify-send "Pomf is up" "c:" |
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
#/usr/bin/sh | |
#Requires Imagemagick xclip curl | |
upload(){ | |
link=`curl -s http://nyazo.ru/upload.php -F "id=''" -F "imagedata=@$1"` | |
echo $link | |
echo $link | xclip | |
} | |
filename="tempychicken.png" | |
if [ -z "$1" ] | |
then |
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
*color0: #292929 | |
*color8: #525252 | |
! red | |
*color1: #cf6a4c | |
*color9: #ff9d80 | |
! green | |
*color2: #99ad6a | |
*color10: #c3e6ad | |
! yellow | |
*color3: #fad07a |
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
#requies xclip curl and imagemagick | |
#!/usr/bin/sh | |
upload(){ | |
res=$(curl -s "http://pomf.se/upload.php" -F "files[]=@$1") | |
IFS='"' read -a array <<< $res | |
link="http://a.pomf.se/${array[17]}" | |
echo $link | |
echo $link | xclip -selection c | |
} | |
file="kok.png" |
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 rand; | |
extern crate time; | |
use rand::Rng; | |
use time::PreciseTime; | |
trait Swappable{ | |
fn swap(&mut self,a:usize,b:usize); | |
} | |
impl Swappable for Vec<i32>{ |
OlderNewer