Skip to content

Instantly share code, notes, and snippets.

@baniol
baniol / run_phonegap.sh
Created November 11, 2012 11:51
run phonegap project build
PG_DIR=/home/baniol/PhoneGapProjects/todo_curl/
PG_APP_NAME=todo
PG_PACKAGE_NAME=com.baniowski.todo
PG_CLASS_NAME=Todo
#PG_CLASS_NAME=$PG_APP_NAME^
cd $PG_DIR;
ant clean;
ant debug;
adb install -r $PG_DIR/bin/$PG_APP_NAME-debug.apk
@baniol
baniol / Fetch.sublime-settings
Created November 16, 2012 20:06
sublime text 2 fetch manage file
{
"files":
{
"jquery": "http://code.jquery.com/jquery.min.js",
"modernizr": "https://github.com/Modernizr/Modernizr/zipball/master",
"normalize": "https://raw.github.com/necolas/normalize.css/master/normalize.css",
"reset": "http://meyerweb.com/eric/tools/css/reset/reset.css"
},
"packages":
{
@baniol
baniol / create-vhost.py
Last active December 11, 2015 08:19 — forked from paramah/create-vhost.py
create apache vhost for linux
#!/usr/bin/python
import os, sys, getopt, socket, stat
from pwd import getpwnam
# important: you have to manually put #@host@ into /etc/hosts file !
# important : you have to call the script from within the target directory !
SITES_DIR = "/etc/apache2/sites-available/"
SCRIPT_DIR = "/home/marcin/scripts/"
HOSTS_FILE = "/etc/hosts"
@baniol
baniol / create-vhost.py
Created January 19, 2013 12:52 — forked from paramah/create-vhost.py
create vhost for nginx
#!/usr/bin/python
import os, sys, getopt, socket
from pwd import getpwnam
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "hd:u:t:s:", ["help", "domain="])
except getopt.GetoptError, err:
print str(err)
usage()
@baniol
baniol / ssh_keygen_copy.sh
Last active December 14, 2015 12:19
ssh-keygen && copy to a remote server
# 1) generate ssh key on your local machine
ssh-keygen
#2) copy your public key to a remote machine with port number
ssh-copy-id '-p XXXXX -i ~/.ssh/id_rsa_your_key.pub username@host'
@baniol
baniol / adduser.sh
Last active March 28, 2024 17:55
Create a new user in osx, mac, terminal, bash
#!/bin/bash
# =========================
# Add User OS X Interactive Command Line
# =========================
# http://superuser.com/questions/202814/what-is-an-equivalent-of-the-adduser-command-on-mac-os-x
getHiddenUserUid()
{
local __UIDS=$(dscl . -list /Users UniqueID | awk '{print $2}' | sort -ugr)
@baniol
baniol / sticky_navbar.js
Created March 30, 2013 16:51
sticky navbar for bootstrap from twitter
// sticky navbar
$(document).scroll(function(){
// If has not activated (has no attribute "data-top"
if (!$('.subnav').attr('data-top')) {
// If already fixed, then do nothing
if ($('.subnav').hasClass('subnav-fixed-top')) return;
// Remember top position
var offset = $('.subnav').offset()
$('.subnav').attr('data-top', offset.top);
}
@baniol
baniol / mocca_develop.scpt
Last active December 16, 2015 12:58
developer env for node / client js project, applescript
tell application "iTerm"
activate
-- Create a new terminal window...
set myterm to (make new terminal)
-- ... and go on within this one.
tell myterm
-- Set the terminal size constraints.
-- set number of columns to 30
@baniol
baniol / tester.scpt
Last active December 17, 2015 02:49
runs dev environment for the responsive-tester app, applescript
tell application "iTerm"
activate
-- Create a new terminal window...
set myterm to (make new terminal)
-- ... and go on within this one.
tell myterm
-- Set the terminal size constraints.
-- set number of columns to 30
<?php
/**
* Controller Test Case
*
* Provides some convenience methods for testing Laravel Controllers.
*
* @author Joseph Wynn <joseph@wildlyinaccurate.com>
*/
abstract class ControllerTestCase extends PHPUnit_Framework_TestCase