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
// Like jQuery's trigger(), only the firing of the event can be delayed by the | |
// specified duration (in milliseconds). The timer is reset on consecutive | |
// triggers with the same event name, so only the most recent event will be | |
// triggered when the duration ends. Useful if you need to prevent events from | |
// queueing up. | |
// | |
// $('#foo').bind('myEventName', function() {alert('hai')}); | |
// ... | |
// $('#foo').delayedTrigger(1000, 'myEventName', 'event1'); | |
// $('#foo').delayedTrigger(1000, 'myEventName', 'event2'); |
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 urllib2 | |
import threading | |
from Queue import Queue | |
import sys, os, re | |
class ThreadedDownload(object): | |
REGEX = { | |
'hostname_strip':re.compile('.*\..*?/', re.I) | |
} |
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
// using: https://github.com/igorescobar/jQuery-Mask-Plugin | |
// version: v0.5.0+ | |
var SPphoneMask = function(phone, e, currentField, options){ | |
return phone.match(/^(\(?11\)? ?9(5[0-9]|6[0-9]|7[01234569]|8[0-9]|9[0-9])[0-9]{1})/g) ? '(00) 00000-0000' : '(00) 0000-0000'; | |
}; | |
$(".sp_celphones").mask(SPphoneMask, {onKeyPress: function(phone, e, currentField, options){ | |
$(currentField).mask(SPphoneMask(phone), options); | |
}}); |
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 Crypto.Cipher import AES | |
from Crypto import Random | |
BS = 16 | |
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
unpad = lambda s : s[0:-ord(s[-1])] | |
class AESCipher: | |
def __init__( self, key ): | |
""" |
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
http://yysource.com/2011/03/debugging-with-css-outline-all-elements/ | |
* { outline: 2px dotted red } | |
* * { outline: 2px dotted green } | |
* * * { outline: 2px dotted orange } | |
* * * * { outline: 2px dotted blue } | |
* * * * * { outline: 1px solid red } | |
* * * * * * { outline: 1px solid green } | |
* * * * * * * { outline: 1px solid orange } | |
* * * * * * * * { outline: 1px solid blue } |
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 os.path | |
import shutil | |
import hashlib | |
import logging | |
# Support both Python 2 and 3 urllib2 importing | |
try: | |
from urllib.request import urlopen, Request | |
except ImportError: | |
from urllib2 import urlopen, Request |
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
<!-- WP Content Copy Protection script by Rynaldo Stoltz Starts - http://securiilock.com --> | |
<div align="center"><noscript> | |
<div style="position:fixed; top:0px; left:0px; z-index:3000; height:100%; width:100%; background-color:#FFFFFF"> | |
<div style="font-family: Tahoma; font-size: 14px; background-color:#FFF000; padding: 10pt;">Please enable your Javascript to see this page as it is meant to appear!</div></div> | |
</noscript></div> | |
<script type="text/javascript"> | |
window.onload = function() { | |
disableSelection(document.body) |
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 java.io.FileDescriptor; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.io.PrintStream; | |
public class HelloWorld{ | |
private static HelloWorld instance; | |
public static void main(String[] args){ | |
instantiateHelloWorldMainClassAndRun(); |
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 -*- | |
# Python 3.4 | |
# author: http://blog.dokenzy.com/ | |
# date: 2015. 4. 8 | |
# References | |
# http://www.imcore.net/encrypt-decrypt-aes256-c-objective-ios-iphone-ipad-php-java-android-perl-javascript/ | |
# http://stackoverflow.com/questions/12562021/aes-decryption-padding-with-pkcs5-python | |
# http://stackoverflow.com/questions/12524994/encrypt-decrypt-using-pycrypto-aes-256 |
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
### NOTE ### | |
The below gist is converted to a blog post and available at below link. Refer that instead. | |
http://hemenkapadia.github.io/blog/2016/11/11/Ubuntu-with-Nvidia-CUDA-Bumblebee.html | |
#### Note about kernel versions #### | |
Between kernel versions 4.2 and 4.4 there are different options that need to bet set | |
to get this working. The same is highlighted below when necessary. I have not tested |
OlderNewer