Skip to content

Instantly share code, notes, and snippets.

@auwsome
auwsome / getFileFromGithub.py
Created August 24, 2015 16:25
Get and read file from Github and save as file
import os, urllib2
realcwd = os.path.dirname(os.path.realpath(__file__))
url1 = 'http://raw.githubusercontent.com/auwsome/pybot/master/Pybot.py'
#urls[1] = 'http://raw.githubusercontent.com/auwsome/pybot/master/sendPybot.py'
#for url in urls[url]:
req = urllib2.Request(url1)
response = urllib2.urlopen(req)
@auwsome
auwsome / Simple-server-Cortana-recognition-redirect-Chrome.py
Last active August 29, 2015 14:28
Simple server that uses Cortana recognition redirected through Chrome search and Python
# from https://gist.github.com/auwsome/7815c3b220de0faf5694
# This code is modified from code by Stephen C Phillips at http://scphillips.com would be nice.
html1 = """HTTP/1.0 200 OK
Content-Type: text/html
<html>
<head>
@auwsome
auwsome / Simple-socket-server-using-threads.py
Created August 23, 2015 22:57
Simple socket server using threads
'''
Simple socket server using threads
'''
import socket
import sys
from thread import *
HOST = '' # Symbolic name meaning all available interfaces
PORT = 8000 # Arbitrary non-privileged port
@auwsome
auwsome / GitHub-Add-Issue
Created August 23, 2015 21:02
Add issue in GitHub using basic authentication and token
# from http://stackoverflow.com/questions/10367859/github-api-giving-404-when-passing-json-data-with-python-urllib2
import urllib2
import json
import getpass
import base64
# Generate a token from the username and password.
# NOTE: this is a naive implementation. Store pre-retrieved tokens if possible.
username = 'pelson'
@auwsome
auwsome / Create-branch-with-Github-API.md
Last active May 8, 2024 20:23 — forked from Potherca/README.md
Create a branch on Github using API and Python