Skip to content

Instantly share code, notes, and snippets.

JacobBennett / jquerySerialize.js
Created March 11, 2014 18:49
Jquery function to serialize an into an object
$.fn.serializeObject = function()
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[] !== undefined) {

###Jeffrey Way (1) - Bootcamp

Jeffrey went through about 12 subjects one right after the other and gave tips along the way.

  1. Mail Drivers for mail notifications.
1. With Laravel 4.2 it’s easier to use APIs like Mailgun and Mandrill for e-mail notifications. This avoids using SMTP which is really cool.
  1. File Generators for generating schema migrations.

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:

class BaseModel extends Eloquent {
public function columns(){
$table = $this->getTable();
return DB::select(" SHOW COLUMNS FROM ".$table);
JacobBennett / gist:7127791f18b679116650
Created October 23, 2014 13:28
Update a program Icon
If you only want to update one Application icon, ie, in just touch the folder. (I've read you need to do the Info.plist as well sometimes, although I've never needed to.)
Close the finder windows and:
touch /Applications/
touch /Applications/
You can refresh the dock icon cache using the commands above, also do a killall Dock to restart it. Personally I would just drag the application in question, off the dock and re-start / keep in dock, because this is generally a one off thing. As always, script it if possible / and you're doing it a lot.
JacobBennett /
Last active August 29, 2015 14:13
Set of blade yield, section, and extend use cases that are handy to remember without having to look up every time :)

Default yield statement


Default Section

	content that will always be present
server {
listen 80;
return 301 $scheme://default$request_uri;
JacobBennett / ExampleUsage.php
Last active October 2, 2015 12:33
Validator that accounts for context of validation
// After injecting the class into your controller, you would call it on a method like so
// store here is the context
// this will validate it against that set of rules
$this->validator->validate(Input::all(), 'store');
JacobBennett / gist:edcda5625098fe3b6bab
Last active October 6, 2015 05:24
Setup Node and Gulp on a Digital Ocean Droplet for Elixir
sudo apt-get update
curl -sL | sudo bash -
sudo apt-get install -y nodejs
npm install -g gulp
// (string) $message - message to be passed to Slack
// (string) $room - room in which to write the message, too
// (string) $icon - You can set up custom emoji icons to use with each message
public static function slack($message, $room = "general", $icon = ":longbox:") {
$data = json_encode(array(
"channel" => "#{$room}",
"text" => $message,
"icon_emoji" => $icon