Skip to content

Instantly share code, notes, and snippets.

View seanbuscay's full-sized avatar

Sean Buscay seanbuscay

View GitHub Profile
@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
@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');
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 / misc.php
Last active September 7, 2018 19:31
Get the first sentence in a string.
function firstSentence($string) {
$sentences = explode(".", $string);
return $sentences[0];
}
git checkout --orphan newbranch
git rm -rf .
<do work>
git add your files
git commit -m 'Initial commit'