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 python3 | |
import time | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(17, GPIO.OUT) | |
# wish it was that easy with people ;) | |
def turn_led_on(): | |
GPIO.output(17, 1) |
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 java.lang.Runnable; | |
import java.net.Socket; | |
import java.util.concurrent.atomic.AtomicBoolean; | |
public class InputListenerThread implements Runnable { | |
private Socket socket; | |
private AtomicBoolean closing; | |
public InputListenerThread(Socket s, AtomicBoolean cl) { |
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 | |
# Ruby script to consolidate all my log folders | |
require 'thread' | |
PREFIX="/home/#{`whoami`}/.config/hexchat/logs/" | |
FOLDERS=["freenode", "freenode over znc", "poke_freenode"] | |
file_q = Queue.new | |
threads = [] |
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 python3 | |
# weird script | |
import sys | |
inp = input("> ") | |
sep = ' ' | |
for i in range(len(inp)): | |
print(sep.join(inp[i:]) + sep + sep.join(inp[0:i])) | |
# box2@box:~ $ python3 Desktop/untitled.py | |
# > VAPORWAVE |
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 python3 | |
# encoding: utf8 | |
# | |
# IRC Relay bot | |
# ------------- | |
# | |
# by boxmein 2015-12-09. license at the end of this file. | |
# | |
# Can relay between multiple servers and channels. Relay links can be defined | |
# live or during configuration. |
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
def condition_code_to_icon(code): | |
if 0 <= code <= 2: return 'weather-severe-alert' | |
elif 3 <= code <= 4: return 'weather-storm' | |
elif 5 <= code <= 8 or 13 <= code <= 18 or code == 35 or 41 <= code <= 43 or code == 46: return 'weather-snow' | |
elif 9 <= code <= 12 or code == 40 or code == 45 or code == 47: return 'weather-showers' | |
elif 19 <= code <= 22: return 'weather-fog' | |
elif 23 <= code <= 25: return 'weather-overcast' | |
elif code == 27 or code == 29: return 'weather-few-clouds-night' | |
elif code == 28 or code == 30: return 'weather-few-clouds' | |
elif code == 31 or code == 33: return 'weather-clear-night' |
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 | |
require 'net/http' | |
Net::HTTP.get_print URI("http://www.asciipr0n.com/pr0n/pinups/pinup#{( rand * 48 ).to_i}.txt") |
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 python3 | |
# encoding: utf-8 | |
# Row Echelon Calculator | |
# (for Gaussian Elimination) | |
# INPUT: | |
# Matrix of any dimensions in the following form: | |
# input := { row, "\n" }, ".\n" | |
# row := { num, " " } | |
# num := <float> |
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 | |
# encoding: utf-8 | |
# Dictionary Scraper | |
# sends a GET request to a dictionary, then scrapes the response with Nokogiri | |
# and returns the result | |
# usage: cat wordlist.txt | ruby scrape-definitions.rb 1>words.txt # 2>errors.txt | |
require 'open-uri' | |
require 'thread' | |
require 'nokogiri' |
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' | |
require 'thread' | |
# If a request fails we queue it for later | |
$fail_queue = Queue.new | |
# Total # of accounts | |
accounts = 144903 | |
# Amount of threads and piles of work | |
N = 4 |