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 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 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 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 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 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 |
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
# Quick Summary Of Balcony Hydroponic Garden | |
## Rig | |
- 2*120cm PVC pipe + bends and fittings | |
- 60l capcaity tank with about 25l nutrient water. | |
- 4*2 holes, 7 chilis, 1 tomato | |
- Type: [Nutrient Film Technique](http://en.wikipedia.org/wiki/Nutrient_film_technique) | |
- Pump schedule: 4 runs per hour, 20 seconds per run (pump a bit too powerful) | |
[The rig](http://i.imgur.com/T3ySmOS.jpg) |
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
#!/bin/bash | |
sudo rsync -avz --delete --one-file-system / /boot backupuser@80.86.92.244:/home/hydrobackup/backups |
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>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 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 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
/** | |
* Small refresher on how to use sqlite3 embedded in node.js | |
* | |
* LINKS: | |
* - Package: https://www.npmjs.com/package/sqlite3 (NOTE: Includes correct platform binary of sqlite3. No extra install required.) | |
* - API: https://github.com/mapbox/node-sqlite3/wiki/API | |
*/ | |
var sqlite3 = require('sqlite3').verbose(); | |
// var db = new sqlite3.Database('./dbfiles/testdb'); |
OlderNewer