Skip to content

Instantly share code, notes, and snippets.

@rayou
rayou / unzip.py
Last active December 15, 2015 19:19 — forked from cesandoval/unzip.py
Python: unzip.py
import zipfile
import os
#Extracts files on a zip file into a given directory, if no directory is given,
#it extracts the files into the zip file directory.
def unzip_file(zip_file, my_path=None):
zip_file = zipfile.ZipFile(zip_file) #open the zip file
if my_path != None: #if directory is given, and doesn't exist, create directory.
if not os.path.isdir(my_path):
@rayou
rayou / .htaccess
Last active December 15, 2015 13:59 — forked from muhittin/codeigniter_htaccess
PHP: Codeigniter_htaccess
RewriteEngine On
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php/$1
@rayou
rayou / Image Replacement
Last active December 15, 2015 07:09 — forked from visualpropaganda/gist:4585619
CSS: Image Replacement
/* H5BP image replacement: http://nicolasgallagher.com/another-css-image-replacement-technique/ */
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}