Skip to content

Instantly share code, notes, and snippets.

@tamboer
tamboer / git-push-new-repo.txt
Created July 4, 2013 08:15
git create a new repo and push to github
Step 1: Create the README file
In the prompt, type the following code:
mkdir ~/Hello-World
# Creates a directory for your project called "Hello-World" in your user directory
cd ~/Hello-World
# Changes the current working directory to your newly created directory
@tamboer
tamboer / ssh_cheatsheet.txt
Last active December 19, 2015 06:09
ssh cheatsheet
REMOVE KEY
ssh-keygen -R hostname //remove a key for a host
cd ~/.ssh
@tamboer
tamboer / git_clean.txt
Created June 24, 2013 10:10
git clean
git clean -f
If you want to also remove directories, run git clean -f -d.
If you just want to remove ignored files, run git clean -f -X.
If you want to remove ignored as well as non-ignored files, run git clean -f -x.
Note the case difference on the X for the two latter commands.
// Common modules
var util = require('util');
var events = require('events');
var http = require('http');
var url = require('url');
var fs = require('fs');
var zlib = require('zlib');
// Simple HTTP server
var s = http.createServer(function (request, response) {
var express = require('express');
var app = express.createServer();
var Client, https, querystring;
https = require('https'),
querystring = require('querystring');
app.get('/', function(req, res) {
//res.send('Hello World');
@tamboer
tamboer / apache_bash.txt
Created June 18, 2013 11:56
apache_bash configuration
sudo a2enmod rewrite
#see modules
sudo apache2ctl -M
sudo /etc/init.d/apache2 reload
sudo a2dismod rewrite
@tamboer
tamboer / simplescreenrecorder.bash
Created June 11, 2013 08:06
install simple screen recorder
sudo add-apt-repository ppa:maarten-baert/simplescreenrecorder
sudo apt-get update
sudo apt-get install simplescreenrecorder
# if you want to record 32-bit OpenGL applications on a 64-bit system:
sudo apt-get install simplescreenrecorder-lib:i386
@tamboer
tamboer / sql_employees_with_contracts.sql
Created June 6, 2013 12:29
sql select employees with contracts between two dates
//not tested 100% there should be some <= >= incorporated depending on ...
$q = "SELECT `employees`
FROM `employee_contract`
WHERE start_date
BETWEEN '$from'
AND '$to'
OR end_date
BETWEEN '$from'
AND '$to'
@tamboer
tamboer / php_array.php
Last active December 18, 2015 03:49
php array add groups to selection and remove groups
<?php
public function addGroupToSelection($groups) {
if (count($groups) > 0)
foreach ($groups as $group)
foreach ($group as $item)
if (!$this->isInGroup($item, $this->main_selection))
$this->main_selection[] = $item;
}
@tamboer
tamboer / date_formats.php
Created June 5, 2013 12:58
php date formats
<?php
// Assuming today is March 10th, 2001, 5:16:18 pm, and that we are in the
// Mountain Standard Time (MST) Time Zone
$today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm
$today = date("m.d.y"); // 03.10.01
$today = date("j, n, Y"); // 10, 3, 2001
$today = date("Ymd"); // 20010310
$today = date('h-i-s, j-m-y, it is w Day'); // 05-16-18, 10-03-01, 1631 1618 6 Satpm01