Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am arapehl on github.
  • I am ara (https://keybase.io/ara) on keybase.
  • I have a public key whose fingerprint is 32DC 5375 BA03 1945 F640 DD9F DF75 2E70 7CA3 6502

To claim this, I am signing this object:

@arapehl
arapehl / no-function.js
Last active August 29, 2015 14:00
Functions should return a value
var contentEl = $('foo').hasClass('content') ? target : $(target).closest('.content');
@arapehl
arapehl / .vimrc
Created October 7, 2013 13:53
My .vimrc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer:
" Amir Salihefendic
" http://amix.dk - amix@amix.dk
"
" Version:
" 5.0 - 29/05/12 15:43:36
"
" Blog_post:
" http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github
@arapehl
arapehl / pig_latin.js
Created April 4, 2013 02:21
A very simple pig latin translator. Won't handle capitals or punctuation.
function pigLatin(phrase) {
var arr, pigged;
arr = phrase.split(" ");
pigged = arr.map(function (word) {
var first, rest;
first = word.substring(0, 1);
rest = word.substring(1);
return rest + first + "ay";
@arapehl
arapehl / gist:1114622
Created July 29, 2011 20:10 — forked from rgrove/gist:1114618
Using YUI group configs to combo handle custom modules
YUI({
groups: {
'my-group': {
comboBase: 'http://example.com/combo?',
combine : true,
root : 'build/',
modules: {
/* custom module definitions */
}
@arapehl
arapehl / parseInt.js
Created June 15, 2011 16:16
Defaults parseInt's radix to 10
if (parseInt('080') === 0) {
/*global _parseInt*/
_parseInt = parseInt;
parseInt = function (str, radix) {
return _parseInt(str, radix || 10);
}
}
var APP = (function(window) {
function parseInt(str, radix) {
radix = radix || 10;
return window.parseInt(str, radix);
}
return {
// Sub-objects and methods that
// use the modified parseInt...
//
@arapehl
arapehl / gist:1019584
Created June 10, 2011 19:24
jQuery vs. YUI 3 custom events
// jQuery
$('#foo').bind('customEvent', function () {
alert('foo');
});
$('#foo').trigger('foo');
// YUI 3
YUI.add('base', function (Y) {
Y.namespace('proof');
}, '0.0.1');