This file contains 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
#!/usr/bin/env python | |
# | |
# A Python implementation of the handy `which' shell command, showing | |
# the full path to a command that's in your path. | |
# | |
# Written by: Senko Rasic <senko.rasic@dobarkod.hr> | |
# | |
# Released to Public Domain. Use it as you like. | |
import sys |
This file contains 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($){ | |
$.fn.textReplace = function(map, patterns) { | |
map = map || {}; | |
patterns = patterns || []; | |
$('*', this).contents().filter(function() { | |
return ((this.nodeType == 3)); | |
}).each(function() { | |
var old_text = $.trim(this.nodeValue); | |
var new_text; |
This file contains 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
#!/usr/bin/env python | |
# A script to find recent download links for a GitHub | |
# repository. | |
# | |
# Written by: Senko Rasic <senko.rasic@dobarkod.hr> | |
# | |
# Released to Public Domain. Use it as you like. | |
import urllib |
This file contains 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 django.shortcuts | |
import inspect | |
def renderlocals(template): | |
""" | |
Renders the template in a RequestContext, passing all local | |
variables to the request context, and returns the resulting | |
HttpResponse. | |
Example usage: |
This file contains 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
/* Hide/show placeholder text in an input field while it's empty | |
* To use, add data-placheholder="placeholder text" to your fields | |
* Eg: <input type="text" id="email" value="" data-placeholder="Enter your e-mail"> | |
*/ | |
$('input[data-placeholder]').each(function(){ | |
$(this) | |
.bind('focus', function() { | |
if ($(this).val() == $(this).data('placeholder')) | |
$(this).val(''); | |
}) |
This file contains 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
diff --git a/pyflakes/checker.py b/pyflakes/checker.py | |
index fa2494e..f1eff00 100644 | |
--- a/pyflakes/checker.py | |
+++ b/pyflakes/checker.py | |
@@ -131,6 +131,7 @@ def names(self): | |
class Scope(dict): | |
importStarred = False # set to True when import * is found | |
+ usesLocals = False |
This file contains 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 | |
# | |
# screen-paste - Paste a screenshot to the Web | |
# | |
# Written by Senko Rasic <senko.rasic@goodcode.io> | |
# Released into Public Domain. Use it as you like. | |
# | |
# The tool allows the user to select a portion of the screen, then copies it | |
# to S3, and stores the resulting URL in clipboard. | |
# |
This file contains 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 | |
# | |
# screen-paste - Paste a screenshot to the Web (using pixbin.us service) | |
# | |
# Written by Senko Rasic <senko.rasic@goodcode.io> | |
# Released into Public Domain. Use it as you like. | |
# | |
# The tool allows the user to select a portion of the screen, then copies it | |
# to pixbin.us, and stores the resulting URL in clipboard. | |
# |
This file contains 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 hashlib import sha1 | |
import unittest | |
__all__ = ['sign_structure'] | |
def sign_structure(data): | |
"""Create a (non-cryptographic) signature of the data structure. | |
This function makes sure that dict item ordering doesn't matter. |
This file contains 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 gettext import translation | |
import os.path | |
from django.conf import settings | |
def get_all_translations(domain): | |
"""Return a language code => translations mapping for all defined | |
languages. This is useful if in a single view you need to use | |
different translation catalogs at the same time. |
OlderNewer