Skip to content

Instantly share code, notes, and snippets.

View ademilsonfp's full-sized avatar

Ademilson ademilsonfp

  • Uberlândia-MG, Brazil
View GitHub Profile
@cowboy
cowboy / Gruntfile.js
Last active December 9, 2015 22:38
grunt 0.4 file.expandMapping and templates
module.exports = function(grunt) {
grunt.initConfig({
stuff: {
dest: 'foo/',
ext: '.bar',
},
log_files: {
my_target: {
files: grunt.file.expandMapping('**/*.js', '<%= stuff.dest %>', {
@oborder
oborder / gist:3103533
Created July 13, 2012 08:08
angularjs directive for bootstrap datepicker : eternicode/bootstrap-datepicker, eyecon.ro
angular.module('bDatepicker', []).
directive('bDatepicker', function(){
return {
require: '?ngModel',
restrict: 'A',
link: function($scope, element, attrs, ngModelCtrl) {
var originalRender, updateModel;
updateModel = function(ev) {
return $scope.$apply(function() {
return ngModelCtrl.$setViewValue(ev.date);
@mwitmer
mwitmer / example.ly
Created May 2, 2012 05:43
A lilypond extension for generating a score and parts from a simple description
#(define paper-size "letter")
\include "ly-score.ly"
#(set-paper-staff-size scorepap 13)
#(ly-score:process "wind-quintet"
`((copyright "Copyright 2012, Mark Witmer") (title "Wind Quintet") (composer "Mark Witmer"))
`((title "Serpents") (tagline "Copyright 2012") (composer "Mark Witmer"))
`(("mvt" ()))
'(StaffGroup "Main Score" flute oboe clarinet-in-b-flat horn bassoon)
#t #t)e
@db
db / jquery.ajax.progress.js
Created May 11, 2011 12:43
add XHR2 progress events to jQuery.ajax
(function addXhrProgressEvent($) {
var originalXhr = $.ajaxSettings.xhr;
$.ajaxSetup({
progress: function() { console.log("standard progress callback"); },
xhr: function() {
var req = originalXhr(), that = this;
if (req) {
if (typeof req.addEventListener == "function") {
req.addEventListener("progress", function(evt) {
that.progress(evt);