start new:
tmux
start new with session name:
tmux new -s myname
*.acn | |
*.acr | |
*.alg | |
*.aux | |
*.bak | |
*.bbl | |
*.bcf | |
*.blg | |
*.brf | |
*.bst |
from fabric.api import * | |
""" | |
Base configuration | |
""" | |
env.project_name = '$(project)' | |
env.database_password = '$(db_password)' | |
env.site_media_prefix = "site_media" | |
env.admin_media_prefix = "admin_media" | |
env.newsapps_media_prefix = "na_media" |
/* | |
For some reason, the change() event only fires when the input field loses focus. | |
Binding to other options ('change keypress paste focus textInput input') will | |
fire the event several times, which is bad. The below code works even when | |
content is pasted into the text field, and only fires once as expected. | |
*/ | |
$('#search-form .term').bind('input', function(){ | |
console.log('this actually works'); | |
}); |
/* | |
Original code by Nick Brenn | |
Modified by Marc de Vinck | |
Make Projects Arduino-based 4WD robot | |
http://makeprojects.com/Project/Build-your-own-Arduino-Controlled-Robot-/577/1 | |
*/ | |
#include <AFMotor.h> | |
AF_DCMotor motor1(1, MOTOR12_8KHZ); | |
AF_DCMotor motor2(2, MOTOR12_8KHZ); | |
AF_DCMotor motor3(3, MOTOR12_1KHZ); |
====================================== | |
Setting up Nginx, uWSGI and Python3 | |
====================================== | |
First off, I'm traditionally a PHP developer, but am looking at moving across to Python. I really struggled to find decent documentation on how to get a server up and running for deploying Python web applications from the point of view of someone coming from PHP. The main problems I came across with documentation were: | |
1) Only showed you how to run the server for a single web application. | |
2) Only showed you how to configure the app, not the server it was running on. | |
My preferred workflow for development is by setting up a new VM in VMware Fusion and then forwarding through all requests to that VM via /etc/hosts. This might not be the optimal way to get things up and running, but it works for me. |
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
-- The section describing iterators was configusing to me. http://www.lua.org/pil/7.1.html | |
-- | |
-- I think it simpler to describe the 'stateless' iterator first, then | |
-- go into the nitty details of a 'stateful' iterator using closures. | |
-- | |
-- | |
-- Example of making an iterator in lua | |
-- | |
-- The 'real' syntax for the 'for' statement is this | |
-- for <v> in <iter-fn>, <thing_2_iterate>, <initial-key> do |
Update and Upgrade the server
$ sudo apt-get update && sudo apt-get upgrade
Follow instructions to add user ubuntu
and grant ubuntu
root priviledges
Install openssh-server
$ sudo apt-get install openssh-server
# Instruct the interpreter to create a network request and create an object representing the request state. This can be done using the urllib module. | |
import urllib.request | |
import tarfile | |
thetarfile = "http://file.tar.gz" | |
ftpstream = urllib.request.urlopen(thetarfile) | |
thetarfile = tarfile.open(fileobj=ftpstream, mode="r|gz") | |
thetarfile.extractall() | |
# The ftpstream object is a file-like that represents the connection to the ftp server. Then the tarfile module can access this stream. Since we do not pass the filename, we have to specify the compression in the mode parameter. |