Skip to content

Instantly share code, notes, and snippets.

@clouddueling
clouddueling / index.blade.php
Last active December 30, 2015 10:58
account view premium app.php
<div id='apps'></div>
<hr>
<script>
var account = {{ json_encode(to_json($account)) }},
meets = {{ json_encode(to_json($meets)) }};
</script>
@include("account.page.premium.app")
@clouddueling
clouddueling / config.js
Created November 26, 2013 01:51
config.js for lintyai brackets
define(function(require, exports){
////////////////////////////////////////////////////////////////////////////////
// http://jshint.com/
exports.javascript = {};
exports.javascript.cmd = '/usr/local/bin/node "%s/jshint/bin/jshint"';
exports.javascript.re = function(data){
var result = [];
data.split('\n').forEach(function(element){
@clouddueling
clouddueling / gist:7652046
Last active December 29, 2015 09:39
.jshintrc
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
@clouddueling
clouddueling / api.php
Created November 21, 2013 18:12
API Handler that makes processing CRUD and other requests more automatic.
<?php
class Api
{
public static function is_eloquent($obj)
{
if (is_array($obj)) {
$obj = isset($obj[0]) ? $obj[0] : $obj;
}
@clouddueling
clouddueling / routes.php
Created November 21, 2013 01:35
MySQL to Migrations for Laravel 3 may work with 4 not sure if it uses same functions.
<?php
Route::get('test', function() {
$schema = SqlMigrations::convert('clouddueling')
->up('
$user = User::create([
"email" => "[email protected]",
"password" => Hash::make("admin"),
"admin" => 1
]);
@clouddueling
clouddueling / Vagrantfile
Last active December 28, 2015 19:59
Vagrant settings laravel 3
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "base"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.network :forwarded_port, guest: 80, host: 5472
<?php
class Analyze
{
/**
* You can either scan your entire project or select some folders.
*
* @var array
*/
public static $dirs = array();
@clouddueling
clouddueling / method1.md
Created November 17, 2013 00:51
REST API Style
  • GET request to /api/users – List all users
  • GET request to /api/users/1 – List info for user with ID of 1
  • POST request to /api/users – Create a new user
  • PUT request to /api/users/1 – Update user with ID of 1
  • DELETE request to /api/users/1 – Delete user with ID of 1
@clouddueling
clouddueling / bash.sh
Created November 16, 2013 22:50
git add -A && git commit -m "$message"
gu () {
if [ "$1" ]
then
message=$1
else
message="update code"
fi
git add -A && git commit -m "$message"
@clouddueling
clouddueling / address.php
Created November 16, 2013 21:58
example laravel 3 controller method api
<?php
class Api_V1_Address_Controller extends Base_Controller
{
public function post_index()
{
try {
$s = extend(array(
'name' => '',
'address_1' => '',