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
#!/bin/bash | |
# Add Vagrant's NFS setup commands to sudoers, for `vagrant up` without a password | |
# Updated to work with Vagrant 1.6.x @see https://github.com/mitchellh/vagrant/pull/3638 | |
# Stage updated sudoers in a temporary file for syntax checking | |
TMP=$(mktemp -t vagrant_sudoers) | |
cat /etc/sudoers > $TMP | |
cat >> $TMP <<EOF | |
# Allow passwordless startup of Vagrant when using NFS. |
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
#!/bin/bash | |
PID_FILE=/var/run/mailcatcher.pid | |
NAME=mailcatcher | |
PROG="/usr/bin/env mailcatcher" | |
USER=mailcatcher | |
GROUP=mailcatcher | |
start() { | |
echo -n "Starting MailCatcher" |
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 | |
public function subscribeEvents() | |
{ | |
Backend::$events->addEvent('shop:onExtendCategoryModel', $this, 'extend_category_model'); | |
} | |
public function extend_category_model($category, $context) | |
{ |
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 | |
class day(){ | |
private $date; | |
public function __construct() | |
{ | |
$this->date = time(); |
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
adb pull /data/data/com.google.android.apps.authenticator2/databases/databases | |
adb push databases /data/data/com.google.android.apps.authenticator2/databases/databases |
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 | |
foreach($products as $p){ | |
echo $p->categories[0]->name . ' ' . $p->sku . ' ' . $p->created_at . ' </br>'; | |
} |
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 | |
$obj = new Shop_Product(); | |
$obj->select('shop_products.id, sum(shop_order_items.quantity) AS "sold"'); | |
$obj->join('shop_order_items', 'shop_products.id = shop_order_items.shop_product_id'); | |
$obj->join('shop_orders', 'shop_order_items.shop_order_id = shop_orders.id'); | |
$best_selling = $obj->where('shop_orders.payment_processed IS NOT NULL')->group('shop_products.id')->find_all(); |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Text Highlight Demo</title> | |
<script type="text/javascript"> | |
jQuery(function($,undefined){ | |
var Sublime = { | |
"theme": "Flatland Dark.sublime-theme", | |
"color_scheme": "Packages/Monokai Extended/Monokai Extended.tmTheme", |
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
/** | |
* NumbersTest | |
* Create a test table filled with 1000 numbers | |
* | |
* Based off single insert code sample #7 from the below SO | |
* @see http://stackoverflow.com/questions/1393951/what-is-the-best-way-to-create-and-populate-a-numbers-table | |
* | |
* Updated for MSSQL with conditional drop table to avoid errors | |
*/ |