Skip to content

Instantly share code, notes, and snippets.

View Agnostic's full-sized avatar

Gilberto Avalos Agnostic

View GitHub Profile
@Agnostic
Agnostic / whocalledme.js
Last active August 29, 2015 13:57
Who called me?
// This is very common in big projects with a lot of scripts,
// when the programmer doesn't know where a function/action was called
// Assigning a reference
$.fn.val2 = $.fn.val;
// Overwriting the original function
$.fn.val = function(){
console.log( this, arguments );
console.log( 'Called from: ', arguments.callee.caller );
@Agnostic
Agnostic / alloy.jmk
Created April 4, 2014 15:47
Titanium Alloy + Jade
// If you don't already have alloy.jmk generated do this inside your app/project folder
// $ alloy generate jmk
task("pre:compile", function(event,logger) {
var wrench = require("wrench"),
fs = require("fs"),
jade = require("jade"),
view_root = event.dir.project,
path = require("path");
@Agnostic
Agnostic / build_ios.sh
Last active August 29, 2015 13:59
Build distribution iOS (Titanium CLI)
titanium build -p ios -F ipad -R ~/ALL_PURPOSE.mobileprovision -T dist-appstore
@Agnostic
Agnostic / c_major_Impromptu.csm
Last active August 29, 2015 14:05
C Major Chord in Impromptu
; C Major Chord
; By Gilberto Avalos
; Clear all
(au:clear-graph)
; Define piano instrument
(define piano (au:make-node "aumu" "dls " "appl"))
(au:connect-node piano 0 *au:output-node* 0)
(au:update-graph)
@Agnostic
Agnostic / c_major_bass.scm
Last active August 29, 2015 14:05
C Major + Bass with Impromptu
; C Major Chord
; By Gilberto Avalos
; You need Impromptu to run this script
; http://impromptu.moso.com.au/downloads.html
; Clear all
(au:clear-graph)
; Define piano instrument
@Agnostic
Agnostic / gist:88c599b046770b641b06
Created November 4, 2014 19:32
.jshintrc sublime
{
// Details: https://github.com/victorporof/Sublime-JSHint#using-your-own-jshintrc-options
// Example: https://github.com/jshint/jshint/blob/master/examples/.jshintrc
// Documentation: http://www.jshint.com/docs/options/
"browser": true,
"esnext": true,
"globals": {
"$": true,
"_": true,
"angular": true,
@Agnostic
Agnostic / is-balanced.js
Created June 29, 2015 23:33
Is a string balanced? [Javascript]
function isBalanced(string) {
var balanced = true;
var parts = string.split('');
var openBraces = /{|\[|\(/;
var closeBraces = /}|\]|\)/;
var stack = [];
for (var i = 0; i < parts.length; i++) {
if (parts[i].match(openBraces)) {
stack.push(parts[i]);
@Agnostic
Agnostic / bouncingBall.js
Created June 5, 2013 15:07
Simple bouncing ball with jQuery.
// Create element
var _ball = document.createElement('div');
_ball.className = 'ball';
// CSS
$(_ball).css({
width: '40px',
height: '40px',
borderRadius: '50%',
position: 'fixed',
@Agnostic
Agnostic / list.html
Last active December 21, 2015 00:58
Custom filter for ngRepeat using objects (AngularJS)
<div ng-controller='listController'>
<input type='text' ng-model='filterInput'>
<ul>
<li ng-repeat='item in items | filter:customFilter'>
{{ item.name }}
</li>
</ul>
</div>
@Agnostic
Agnostic / gist:826bf7985ebaebeebf5d5f51d7c94110
Created June 17, 2016 21:12
Interview ID - 57645f3029e1bcc02c000254
f80681c41c43b41fea575b8ae8d8dc8e: {locked_at : 2016-06-17 21:08:15 UTC}
f80681c41c43b41fea575b8ae8d8dc8e: {keep_alive_at : 2016-06-17 21:08:15 UTC}
f80681c41c43b41fea575b8ae8d8dc8e: {last_error : }
f80681c41c43b41fea575b8ae8d8dc8e: {active_at : }
f80681c41c43b41fea575b8ae8d8dc8e: {created_at : 2016-06-17 21:08:15 UTC}
f80681c41c43b41fea575b8ae8d8dc8e: {job : {"params"=>{"user_id"=>"56c37cf4f7bb36d06a000071", "organization_id"=>"56c37b61f7bb36d06a00003a", "event"=>"schedule_live_interview", "timestamp"=>1466197695}, "class"=>"Jobs::Intercom::CreateEventJob"}}
f80681c41c43b41fea575b8ae8d8dc8e: {queue_options : {}}
f80681c41c43b41fea575b8ae8d8dc8e: SUCCESS: Created event schedule_live_interview for organization 56c37b61f7bb36d06a00003a successfuly
f80681c41c43b41fea575b8ae8d8dc8e: Completed job 576466bf29e1bc39da00000c
f80681c41c43b41fea575b8ae8d8dc8e: Harakiri