Skip to content

Instantly share code, notes, and snippets.

View abrjagad's full-sized avatar

Abraham Jagadeesh abrjagad

View GitHub Profile
@peduarte
peduarte / esnextbin.md
Last active August 25, 2022 14:55
Vanilla Debounce
@isellsoap
isellsoap / gist:8299726
Last active February 13, 2023 23:11
A Sass function for converting px to em values. Works with mixed px and em values and with nested em structures.
$base-font-size: 16px;
/**
* Strips the unit from a given number-unit-combination and returns the number.
* @link: http://stackoverflow.com/a/12335841/1779999
* @usage: parse-int(10px) => 10
*/
@function parse-int($number) {
@return $number / ($number * 0 + 1);
@abdulapopoola
abdulapopoola / gist:5251693
Last active March 27, 2017 02:58
Public, Private and Static Methods; JavaScript Style
//Constructor
var Person = function (name, age){
//private properties
var priv = {};
//Public properties
this.name = name;
this.age = age;
//Public methods
@localpcguy
localpcguy / swipeFunc.js
Created November 17, 2011 16:00
Simple Mobile Swipe function to get the swipe direction
var swipeFunc = {
touches : {
"touchstart": {"x":-1, "y":-1},
"touchmove" : {"x":-1, "y":-1},
"touchend" : false,
"direction" : "undetermined"
},
touchHandler: function(event) {
var touch;
if (typeof event !== 'undefined'){
@douglasmiranda
douglasmiranda / get-latest-videos.js
Created September 21, 2011 15:05
Get latest videos from Youtube with Jquery (Gdata API)
function show_my_videos(data){
html = ['<ul id="youtube-videos">'];
$(data.feed.entry).each(function(entry){
url = this.link[0].href;
url_thumbnail = this.media$group.media$thumbnail[3].url;
description = this.media$group.media$description.$t;
html.push('<li><a href="'+url+'">');
html.push('<img src="'+url_thumbnail+'" alt="'+description+'">');
html.push('</a></li>');
});