Skip to content

Instantly share code, notes, and snippets.

View noeldiaz's full-sized avatar

Noel Diaz noeldiaz

  • Baylor College of Medicine
  • Houston, TX
View GitHub Profile
@noeldiaz
noeldiaz / app.js
Created January 20, 2013 05:15 — forked from Xaynder/app.js
//// ---- Menu window, positioned on the left
var menuWindow = Ti.UI.createWindow({
top:0,
left:0,
width:150
});
menuWindow.open();
//// ---- Menu Table
// Menu Titles
@noeldiaz
noeldiaz / global.php
Created May 6, 2013 20:35
Log laravel events into database.
<?php
// app/start/global.php
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
Event::listen('illuminate.query', function($query, $bindings, $time) {
static $count;
if(App::make('env') === 'local')
{
$logFile = __DIR__.'/storage/logs/queries';
ob_start();
var_dump($bindings, $query);
$str = ob_get_clean();
if($count === null)
{
@noeldiaz
noeldiaz / xvfb
Created May 24, 2013 01:56 — forked from jterrace/xvfb
XVFB=/usr/bin/Xvfb
XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset"
PIDFILE=/var/run/xvfb.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
stop)

Have a writable folder public/blog_images in you app.

###routes.php

// Redactor Blog Upload
Route::post('redactorUpload', function()
{
    $file = Input::file('file');
    $fileName = $file->getClientOriginalName();
 
public function setPasswordAttribute($value)
{
$this->attributes['password'] = Hash::make($value);
}
@foreach (array_slice($posts->toArray(), 0, 5) as $post)
<h1>{{ $post['title'] }}</h1>
@endforeach
{
"word_separators": "./\\()\"'-:,.;<>~!@#%^&*|+=[]{}`~?"
}
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo 'Copied to clipboard.'"
@noeldiaz
noeldiaz / tip.sh
Created August 15, 2013 18:06 — forked from JeffreyWay/tip.sh
alias gundo='git reset HEAD~ && git clean -df'