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/bash | |
run-one terminator | |
wmctrl -ia "$(wmctrl -lp | grep "Terminator" | tail -1 | awk '{print $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 celery import task, subtask, group | |
@task | |
def get_list(amount): | |
return [i for i in range(amount)] | |
@task | |
def process_item(item): | |
# do stuff |
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 line_profiler import LineProfiler | |
import random | |
def do_stuff(numbers): | |
s = sum(numbers) | |
l = [numbers[i]/43 for i in range(len(numbers))] | |
m = ['hello'+str(numbers[i]) for i in range(len(numbers))] | |
numbers = [random.randint(1,100) for i in range(1000)] | |
lp = LineProfiler() |
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 InstagramAPI import Instagram | |
def get_user_info_and_login(): | |
try: | |
username = raw_input('Your Instagram username:\n') | |
password = raw_input('Your Instagram password:\n') | |
print 'Wait a second, logging in your account.\n' | |
api = Instagram(username, password) | |
api.login() |
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 difflib from 'difflib'; | |
// Password Validation | |
export function userAttributeSimilarityValidator(password, attributes) { | |
const DEFAULT_USER_ATTRIBUTES = ['first_name', 'last_name', 'email']; | |
const max_similarity = 0.7; | |
for (let user_attr of DEFAULT_USER_ATTRIBUTES) { |
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
# coding: utf-8 | |
import cv | |
import cv2 | |
import numpy as np | |
from sklearn.cluster import KMeans | |
class BoVF(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
import tempfile | |
from PIL import Image | |
class PhotoCreateAPIViewTest(TestCase): | |
def setUp(self): | |
super().setUp() | |
self.tmp_file = tempfile.NamedTemporaryFile(suffix='.jpg') | |
image = Image.new('RGB', (100, 100)) |