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 sh | |
organization = "gerhc" | |
repos = [] | |
DESTINATION_FOLDER = "./repo_bundles" | |
for repo in repos: | |
print(f"Bundling {repo}") | |
sh.git("clone", f"[email protected]:{organization}/{repo}.git") |
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 serial | |
import os | |
import sys | |
import time | |
chunk_size = 5000 | |
os.chdir("D:\govind\Python\RN-wifly") | |
print "Starting WiFly Comm" | |
# To change baudrate -> set uart baudrate 115200, then save <CR>, then reboot |
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 hashlib | |
import justext | |
import re | |
import redis | |
import requests | |
from queue import Queue as ThreadQueue | |
from threading import Thread | |
from multiprocessing import Process, Queue |
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
### Keybase proof | |
I hereby claim: | |
* I am gerhc on github. | |
* I am gerhc (https://keybase.io/gerhc) on keybase. | |
* I have a public key whose fingerprint is D6D3 BEFB 0A4B 2796 E071 327C D9D0 D829 D1C6 9953 | |
To claim this, I am signing this object: |
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
// add the filter to your application module | |
angular.module('yourAppName', ['filters']); | |
/** | |
* Truncate Filter | |
* @Param string | |
* @Param int, default = 10 | |
* @Param string, default = "..." | |
* @return string | |
*/ |
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
pip install django-social-auth -i https://pypi.python.org/simple/ |
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 base64 | |
import os | |
from tastypie.fields import FileField | |
from django.core.files.uploadedfile import SimpleUploadedFile | |
class Base64FileField(FileField): | |
""" | |
A django-tastypie field for handling file-uploads through raw post data. | |
It uses base64 for en-/decoding the contents of the file. | |
Usage: |
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 django.db import models | |
import uuid | |
class UUIDField(models.CharField) : | |
def __init__(self, *args, **kwargs): | |
kwargs['max_length'] = kwargs.get('max_length', 64 ) | |
kwargs['blank'] = True | |
models.CharField.__init__(self, *args, **kwargs) |
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
xhr = new XMLHttpRequest(); | |
xhr.open("POST", "add_specs/", false); | |
xhr.setRequestHeader("Cache-Control", "no-cache"); | |
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); | |
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); | |
data = JSON.stringify(spec_rows); | |
xhr.send(data); |
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
#!/bin/sh | |
/home/omab/x.py & | |
LASTPID=$! | |
sleep 1m | |
kill $LASTPID |