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
<html> | |
<head> | |
<title>My First PHP Page</title> | |
</head> | |
<body> | |
<?php | |
// Change these to actual directory paths (including trailing slash '/') | |
$SOURCE_DIR = '/Users/anders/tmp/from/'; | |
$DESTINATION_DIR = '/Users/anders/tmp/to/'; |
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.text.SimpleDateFormat; | |
import java.text.ParseException; | |
import java.util.Date; | |
import java.util.Locale; | |
/** Parse UTC time from Twitter's created_at field. | |
* | |
* Compile and run: javac TwitterDateParser.java && java TwitterDateParser |
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.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.Date; | |
import java.util.TimeZone; | |
public class DateAritmethics { | |
public static void main(String[] args) { | |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# Every Vagrant virtual environment requires a box to build off of. | |
# Named boxes, like this one, don't need a URL, since the are looked up |
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
/** | |
* A mini "template engine". | |
* Arguments: | |
* template - A string of looking like "Something {{variableName}} and {{nested.object.data}}" | |
* data - A Javascript object with properties to substitute into the template | |
* | |
* Returns: | |
* A string with the variables substituted with the corresponding properties from the data | |
*/ | |
var applyTemplate = function(template, data) { |
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
// Basic Aruino sketch to dump received RF signal, together with some rudimentary hysterisis/filtering | |
// RF Link pinouts: http://www.seeedstudio.com/wiki/433Mhz_RF_link_kit | |
#define rfRECEIVE A0 //RF Receiver pin = Analog pin 0 | |
const int RXLED = 13; // internal LED | |
unsigned int data = 0; // variable used to store received data | |
const unsigned int upperThreshold = 700; //upper threshold value | |
const unsigned int lowerThreshold = 300; //lower threshold value |
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
#!/bin/sh | |
# From http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html | |
# | |
# You need to run this script as root | |
# | |
# su - | |
echo "INSTALLING JAVA 8 AS USER `whoami` " | |
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list |
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
#!/bin/bash | |
# | |
# ____ Install Uncomplicated Firewall (frontend to iptables) | |
# | |
sudo apt-get install -y ufw | |
# Be paranoid | |
sudo ufw disable |
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
#!/bin/sh | |
su - | |
mkdir ./downloads | |
cd downloads | |
rm -rf /uss/lib/iojs* | |
rm /usr/bin/iojs | |
rm /usr/bin/node | |
rm /usr/bin/npm |
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
sudo iptables -L -n |
OlderNewer