Skip to content

Instantly share code, notes, and snippets.

View seanbuscay's full-sized avatar

Sean Buscay seanbuscay

View GitHub Profile
@seanbuscay
seanbuscay / remove file
Created May 16, 2013 15:54
Shell commands to remove Files #shell
rm command syntax
rm (short for remove) is a Unix / Linux command which is used to delete files from a filesystem. Usually, on most filesystems, deleting a file requires write permission on the parent directory (and execute permission, in order to enter the directory in the first place). The syntax is as follows:
rm -f -r {file-name}
Where,
-f: Forcefully remove file
-r: Remove the contents of directories recursively
; Create a Tar of All in Directory
tar cvf backup.tar . 
; Untar
 tar xvf filename.tar
; Exclude files
@seanbuscay
seanbuscay / mySQL table to html.php
Created May 23, 2013 14:32
Output mysql table to html.
//The CSS
//table.db-table { border-right:1px solid #ccc; border-bottom:1px solid #ccc; }
//table.db-table th { background:#eee; padding:5px; border-left:1px solid #ccc; border-top:1px solid #ccc; }
//table.db-table td { padding:5px; border-left:1px solid #ccc; border-top:1px solid #ccc; }
//Some CSS properties may need to be vendor-prefixed.
//The CSS I'm styling the table with is as basic as it gets -- style as you wish!
//The PHP / MySQL
/* connect to the db */
$connection = mysql_connect('localhost','username','password');
@seanbuscay
seanbuscay / clean_open_woth.sh
Created June 3, 2013 19:28
Clean up open with menu on Mac OSX
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
@seanbuscay
seanbuscay / array2csv.php
Created June 6, 2013 23:34
write to csv file
function array2csv(array &$array)
{
if (count($array) == 0) {
return null;
}
ob_start();
$df = fopen("php://output", 'w');
fputcsv($df, array_keys(reset($array)));
foreach ($array as $row) {
fputcsv($df, $row);
@seanbuscay
seanbuscay / fputcsv.php
Created June 6, 2013 23:40
write to csv file
<?php
$list = array (
    array('aaa', 'bbb', 'ccc', 'dddd'),
    array('123', '456', '789'),
    array('"aaa"', '"bbb"')
);
$fp = fopen('file.csv', 'w');
@seanbuscay
seanbuscay / Selenium_find_font_weight
Created June 10, 2013 00:20
Selenium find font weight.
Command: assertEval
Target: var x = window.document.querySelector('body.home.es ul'); window.getComputedStyle(x,null).getPropertyValue('font-weight');
Value: 700
killall -KILL Finder
- unstable:
-- API expansion & trial
-- time to test & open as many feature/support requests as imaginable
- alpha:
-- API freeze proposal
-- new feature requests will be considered as long as they don't imply perceptible API changes
-- revisit disadvantaged spots (e.g. static cache, theming support, documentation)
-- critical bugs should not go beyond alphas
- beta:
-- code freeze
@seanbuscay
seanbuscay / git_create_orphan.sh
Created June 27, 2013 15:26
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name