Skip to content

Instantly share code, notes, and snippets.

View Agnostic's full-sized avatar

Gilberto Avalos Agnostic

View GitHub Profile
@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 / 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 / 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 / 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 / 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',
@khakimov
khakimov / gist:3558086
Created August 31, 2012 19:49
Matrix Effect in you terminal
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'