Skip to content

Instantly share code, notes, and snippets.

View shekarsiri's full-sized avatar
👋

Shekar Siri shekarsiri

👋
View GitHub Profile
@shekarsiri
shekarsiri / kind.js
Created August 5, 2013 22:38 — forked from k33g/kind.js
// Just do this : (and include backbone.js)
var Kind = function() {
this.initialize && this.initialize.apply(this, arguments);
};
Kind.extend = Backbone.Model.extend
//Simpler
var Thing = function() {};
Thing.extend = Backbone.Model.extend
@shekarsiri
shekarsiri / phpunit.rb
Last active December 20, 2015 20:09 — forked from itspriddle/phpunit.rb
require 'formula'
class Phpunit < Formula
homepage 'http://www.phpunit.de/manual/current/en/index.html'
url 'http://pear.phpunit.de/get/phpunit.phar'
sha1 '88d4919ffc91c9aec8aea2b28e500d3e43e2b13b'
version 'HEAD'
def install
bin.install "phpunit.phar" => "phpunit"
#puppet module install example42/php;
#puppet module install puppetlabs/apache;
#puppet module install puppetlabs/mysql"
# config.vm.provision :puppet do |puppet|
# puppet.manifests_path = "manifests"
# puppet.manifest_file = "site.pp"
# puppet.module_path = "/Users/[USERNAME]/.puppet/modules"
# end
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@if (App::environment() == 'local')
@foreach (DB::getQueryLog() as $query)
<script>console.log(' {{ $query['query'] . ' (' . $query['time'] . ' secs)' }} ')</script>
@endforeach
@endif
<?php
/*********************************************************************************************
* Example usage (In view)
* <div class="welcome">
<?php echo Form::open(array('route'=>'process','class'=>'form-horizontal'))?>
<?php echo Form::textField('first_name')?>
<?php echo Form::textField('last_name')?>
<?php echo Form::emailField('email')?>
<?php echo Form::passwordField('password')?>
<?php echo Form::selectField('select_one', array('1'=>'abc', '2'=>'def'))?>
@shekarsiri
shekarsiri / 0_reuse_code.js
Created July 12, 2014 06:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@shekarsiri
shekarsiri / script
Last active August 29, 2015 14:08 — forked from ujjwalk308/script
/* Magic Script. But the question is, will this work? :3 FUCK YEAH IT DID, FGT! */
function getMyToken() {
var cookies = " " + document.cookie,
cookieName = "aid";
var index = cookies.indexOf(" " + cookieName + "=");
if (index == -1) {
index = cookies.indexOf(";" + cookieName + "=");
}
if (index == -1 || cookieName == "") {
# This is Simple Audio Plugin for AngularJS
# service
class AngularAudio
constructor:() ->
@cache = {}
play:(id) ->
audio = null
class window.BaseGanttChart
constructor: (elementId) ->
@elementId = elementId
createDurations: () ->
throw new Error "Need to implement this method in child class"
deleteDurations: () ->
window.location.hash = '#/confirmDelete'