Skip to content

Instantly share code, notes, and snippets.

View nhomar's full-sized avatar
🏠
Life is beautiful

Nhomar [Vauxoo] nhomar

🏠
Life is beautiful
View GitHub Profile
from __future__ import print_function
def bad_case():
"""Closing over a loop variable."""
lst = []
dct = {}
for i in range(10):
meth = i
print([meth for meth in g_lst]) # good case if you use the meth and is not used anymore
@nhomar
nhomar / screenshot
Created October 5, 2015 06:12 — forked from dotStart/screenshot
Provides a simple Amazon S3 screenshot tool.
#!/bin/bash
#----------
# Akkarin's Simple S3 Screenshot Script
#
# Requirements:
# - shutter
# - awscli
# - zenity
#
# Note: The directory defined in $SCREENSHOT_PATH needs to exist!
@nhomar
nhomar / .bashrc
Last active August 29, 2015 14:07 — forked from marioBonales/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys,json,urllib
from pysrt import SubRipFile, SubRipItem
url_string = 'http://ajax.googleapis.com/ajax/services/language/'
def detect(text):
query = dict(v='1.0', q=text)