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 sys | |
count = 0 | |
board = [x[:] for x in [[0]*8]*8] | |
def drawBoard(): | |
for i in range(0, len(board)): | |
if(i>0): | |
sys.stdout.write(" | "+str(i-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
from Tkinter import * | |
import time, thread | |
master = Tk() | |
master.title("Switch test") | |
w = Canvas(master, width=200, height=200) | |
w.pack() | |
w.create_rectangle(0, 0, 200, 100, fill="white") |
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 sys | |
if len(sys.argv) <= 1: | |
sys.argv.append("/usr/share/dict/words") | |
f = open(sys.argv[1], "r") | |
order = "qazwsxedcrfvtgbyhnujmikolp" | |
for line in f: |
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 sys | |
matrix = [[0 for i in range(9)] for j in range(9)] | |
#m = [list("003020600"),list("900305001"),list("001806400"),list("008102900"),list("700000008"),list("006708200"),list("002609500"),list("800203009"),list("005010300")] | |
# | |
#for x in range(0, len(matrix)): | |
# for y in range(0,len(matrix[0])): | |
# matrix[x][y] = int(m[x][y]) |
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
output = "" | |
for x in range(0, 9): | |
line = raw_input() | |
for y in range(0, 9): | |
if (line[y] != 0): | |
output += str(x) + " " + str(y) + " " + line[y] | |
output += "\n" | |
output += "0 0 0\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 'net/http' | |
require 'net/https' | |
@toSend = '{"currency":"USD","models":[{"toolID":"","modelReference":"model.xml","materialID":"12a65a42-df49-47a9-8828-0efaf84c5509","finishID":"c9c27ce3-eee4-47e4-a896-a9010a7971fd","quantity":1,"xDimMm":24.053077028234622,"yDimMm":24.671680341529406,"zDimMm":9.59760028403155,"volumeCm3":0.27144738160643134,"surfaceCm2":7.8405772975064245}],"shipmentInfo":{"countryCode":"US","stateCode":"NH","city":"Nashua","zipCode":"03063"}}' | |
uri = URI.parse("https://i.materialise.com/web-api/pricing") | |
https = Net::HTTP.new(uri.host,uri.port) | |
https.use_ssl = true | |
req = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' =>'application/json', 'Accept' => 'json', 'APICode' => '0FE2EF5F-95E3-4552-B637-55B824E3EF35'}) | |
req.body = "#{@toSend}" |
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 check_for_whole_start_tag(self, i): | |
rawdata = self.rawdata | |
locatestarttagend = re.compile(r""" | |
<[a-zA-Z][-.a-zA-Z0-9:_]* # tag name | |
(?:\s+ # whitespace before attribute name | |
(?:[a-zA-Z_][-.:a-zA-Z0-9_]* # attribute name | |
(?:\s*=\s* # value indicator | |
(?:'[^']*' # LITA-enclosed value | |
|\"[^\"]*\" # LIT-enclosed value | |
|[^'\">\s]+ # bare value |
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
function getShortURL(url) | |
{ | |
return jQuery.ajax({ | |
'type': 'POST', | |
'url': "https://www.googleapis.com/urlshortener/v1/url", | |
'contentType': 'application/json', | |
'data': JSON.stringify({"longUrl" : url}), | |
'success': function(data){console.log(data.id)} | |
}); | |
} |
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
USER='USERNAME' # edit this | |
PASS='PASSWORD' # edit this | |
rm cookies.txt | |
COOKIES='cookies.txt' | |
USER_AGENT='Firefox/3.5' | |
curl --silent -X GET 'https://spire.umass.edu' --user-agent $USER_AGENT --cookie $COOKIES --cookie-jar $COOKIES --location >/dev/null | |
curl --silent -X POST 'https://www.spire.umass.edu/psp/heproda/' --user-agent $USER_AGENT --data-urlencode "userid=${USER}" --data-urlencode "pwd=${PASS}" --data-urlencode "languageCd=ENG" --data-urlencode "timezoneOffset=0" --data-urlencode "Submit=Go" --data-urlencode "cmd=login" --cookie $COOKIES --cookie-jar $COOKIES >/dev/null |
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
// ==UserScript== | |
// @name Twitch Color Strip | |
// @namespace http://www.twitch.tv/ | |
// @version 0.1 | |
// @description Removes all colors from the chat in twitch | |
// @match http://www.twitch.tv/* | |
// @copyright vgmoose | |
// @icon http://vgmoose.com/5ff376.png | |
// ==/UserScript== |
OlderNewer