Flask is a Python web framework that's steadily increasing in popularity within the webdev world. After reading so many great things about Flask, I decided to try it out myself. I personally find testing out a new framework difficult, because you must find a project complex enough to reveal the framework's quirks, but not so daunting as to take the fun out of the project. Luckily, my PHP/Wordpress powered website filled this role quite nicely - the website simply consists of static content, a contact page, and a blog. If I could not convert such a simple site over to Flask, I would immediately know that Flask and I would not make a good team.
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
# encode a video | |
# arg1: video origin | |
# arg2: destination | |
function encode_video(){ | |
ffmpeg -y -i $1 -pass 1 -vcodec libx264 -b 756k -g 15 -bf 3 -refs 6 -b_strategy 1 -coder 1 -qmin 10 -qmax 51 -sc_threshold 40 -flags +loop -cmp +chroma -me_range 16 -me_method umh -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -directpred 3 -flags2 +dct8x8+wpred+bpyramid+mixed_refs -trellis 1 -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -acodec libfaac -ab 64k $2 | |
ffmpeg -y -i $1 -pass 2 -vcodec libx264 -b 756k -g 15 -bf 3 -refs 6 -b_strategy 1 -coder 1 -qmin 10 -qmax 51 -sc_threshold 40 -flags +loop -cmp +chroma -me_range 16 -me_method umh -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -directpred 3 -flags2 +dct8x8+wpred+bpyramid+mixed_refs -trellis 1 -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -acodec libfaac -ab 64k $2 | |
} |
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
# How long to brute force keys | |
ks = 1000000000 # A billion keys per second | |
clusters = 10 # How many computers in the cluster attacking our key? | |
numChars = 38 # We have 38 characters available to use in the key | |
n = 100 # Length of the key string | |
combinations = numChars ** n # This ignores variable length too | |
# How many years it would take a single computer to brute force. |
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
<html> | |
<head> | |
<title>Stupid jQuery table sort</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript" src="stupidtable.js?dev"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
$("table").stupidtable(); | |
console.log($("table tbody tr td").eq(0)) | |
$("table th").bind("click", function(){ |
Many of us seek to improve ourselves beyond what's required. Many CS students are not content to just make good grades in class; they want to get their hands dirty with real-world projects. Many employees read up on the latest languages and frameworks well beyond office hours, simply because they want to play with technology while learning to build a better product. It's important, however, to ensure our time spent studying new programming techniques does not go to waste.
!(confused) != knowledgeable
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
" use Ctrl+L to toggle the line number counting method | |
function! g:ToggleNuMode() | |
if &nu == 1 | |
set rnu | |
else | |
set nu | |
endif | |
endfunction | |
nnoremap <C-L> :call g:ToggleNuMode()<cr> |
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
/etc/apt$ sudo apt-get upgrade | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
You might want to run 'apt-get -f install' to correct these. | |
The following packages have unmet dependencies: | |
libqt4-declarative : Depends: libqt4-sql (= 4:4.8.1-0ubuntu4.2) but 4:4.8.1-0ubuntu4.1 is installed | |
Depends: libqt4-xmlpatterns (= 4:4.8.1-0ubuntu4.2) but 4:4.8.1-0ubuntu4.1 is installed | |
libqt4-declarative:i386 : Depends: libqt4-sql:i386 (= 4:4.8.1-0ubuntu4.2) but 4:4.8.1-0ubuntu4.1 is installed | |
Depends: libqt4-xmlpatterns:i386 (= 4:4.8.1-0ubuntu4.2) but 4:4.8.1-0ubuntu4.1 is installed |
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
E: Unmet dependencies. Try using -f. | |
~/Downloads$ sudo apt-get upgrade -f | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
Correcting dependencies... Done | |
The following packages have been kept back: | |
hplip hplip-data libhpmud0 libsane-hpaio linux-generic linux-headers-generic linux-image-generic printer-driver-hpcups printer-driver-hpijs vlc vlc-nox vlc-plugin-notify vlc-plugin-pulse | |
The following packages will be upgraded: | |
accountsservice akregator apport apport-kde aptdaemon aptdaemon-data ark banshee banshee-extension-soundmenu base-files bind9-host cron cups cups-bsd cups-client cups-common cups-driver-gutenprint cups-ppdc dconf-gsettings-backend |
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
/Downloads$ sudo apt-get update; lsb_release -a | |
Ign http://mirror.lstn.net precise InRelease | |
Ign http://mirror.lstn.net precise-security InRelease | |
Ign http://mirror.lstn.net precise-updates InRelease | |
Ign http://mirror.lstn.net precise-proposed InRelease | |
Ign http://mirror.lstn.net precise-backports InRelease | |
Hit http://mirror.lstn.net precise Release.gpg | |
Hit http://mirror.lstn.net precise-security Release.gpg | |
Hit http: |
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
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install chromium-browser | |
sudo apt-get install git | |
sudo apt-get install vim | |
sudo apt-get install screen | |
ssh-keygen -t rsa | |
mkdir ~/web | |
mkdir ~/web/github | |
mkdir ~/web/lab |