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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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
public function get_export() | |
{ | |
$table = Cpmreport::all(); | |
$file = fopen('file.csv', 'w'); | |
foreach ($table as $row) { | |
fputcsv($file, $row->to_array()); | |
} | |
fclose($file); | |
return Redirect::to('consolidated'); | |
} |
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
class ArrayToXML | |
{ | |
/** | |
* The main function for converting to an XML document. | |
* Pass in a multi dimensional array and this recrusively loops through and builds up an XML document. | |
* | |
* @param array $data | |
* @param string $rootNodeName - what you want the root node to be - defaultsto data. | |
* @param SimpleXMLElement $xml - should only be used recursively | |
* @return string XML |
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
UPDATE table SET fieldname=REPLACE(fieldname, 'MB', '') |
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
$ curl https://install.meteor.com | /bin/sh | |
$ meteor create ~/my_cool_app | |
$ cd ~/my_cool_app | |
$ subl . |
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 chown -R mysql /usr/local/mysql/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
<?php | |
/** | |
* Database Query Result Set | |
* @param string $query SQL Statement eg "SELECT * FROM students" | |
* @return array array from database result | |
*/ | |
public function db_query($query) | |
{ | |
// Run the $query using $this->connection() which | |
// is the database connection in the previous function |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Brck</title> | |
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script> | |
setInterval(function(){ | |
$.ajax({ url: "http://localhost:9000/sim.php", success: function(data){ | |
//Update your dashboard gauge | |
console.log(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
/* Taken zigmob's (http://forums.macrumors.com/showthread.php?t=1742566) workaround a step further | |
And added some triggers to clean up these dodgy character combinations (ff, fi, fl). | |
Still crashes on initial message read but saves having to manually run the sql query eve time a message contains the character combinations */ | |
-- Working well for me so far -- | |
/* | |
Kane Lai 2014-07-13 | |
Improved by updating only the affected row in the trigger. | |
Also, supplied the restore script too. | |
*/ |
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
set nocompatible " Disable vi-compatibility | |
set t_Co=256 | |
colorscheme xoria256 | |
set guifont=menlo\ for\ powerline:h16 | |
set guioptions-=T " Removes top toolbar | |
set guioptions-=r " Removes right hand scroll bar | |
set go-=L " Removes left hand scroll bar | |
set linespace=15 |