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 os | |
number = len([name for name in listdir('.') if isfile(name)]) |
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
def download(url): | |
""" | |
Copy a file from a given url to a local file | |
""" | |
import urllib | |
webfile = urllib.urlopen(url) | |
localfile = open(url.split('/')[-1], 'w') | |
localfile.write(webfile.read()) | |
webfile.close() | |
localfile.close() |
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
<?php | |
class SQLConnection { | |
private $link, $host, $user, $pass, $dbname, $new, $flags; | |
function __construct($host, | |
$user, | |
$pass, | |
$dbname = "", | |
$new = false, | |
$flags = 0, |
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
Emacs Commands List | |
C = Control | |
M = Meta = Alt|Esc | |
Basics | |
C-x C-f "find" file i.e. open/create a file in buffer | |
C-x C-s save the file | |
C-x C-w write the text to an alternate name | |
C-x C-v find alternate file |
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
Screen Capture to disk: | |
⌘ ⇧ 3 Screen to jpeg file on desktop | |
⌘ ⇧ 4 + Drag: Selection to jpeg file on desktop | |
⌘ ⇧ 4 + Spacebar: Window (click camera) to jpeg file | |
Screen Capture to clipboard: | |
⌘ ⇧ 3 + Ctrl: Screen to clipboard | |
⌘ ⇧ 4 + Drag + Ctrl: Selection to clipboard | |
⌘ ⇧ 4 + Spacebar + Ctrl Window (Camera effect) |
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
<!-- Place in between head tag… --> | |
<meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com"> |
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
# Directories # | |
/build/ | |
/bin/ | |
target/ | |
# OS Files # | |
.DS_Store | |
*.class | |
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
bla='\033[0;30m' | |
red='\033[0;31m' | |
gre='\033[0;32m' | |
yel='\033[0;33m' | |
blu='\033[0;34m' | |
mag='\033[0;35m' | |
cya='\033[0;36m' | |
whi='\033[0;37m' | |
nc='\033[0m' |
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
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
done | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" |
OlderNewer