Skip to content

Instantly share code, notes, and snippets.

Gabriel Neutzling gneutzling

Block or report user

Report or block gneutzling

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
fernandoporazzi / selector.js
Created Mar 24, 2014
A small library to retrieve DOM elements like jQuery.
View selector.js
;(function(w, d, undefined){
'use strict';
var $ = function (e) {
var firstChar = e.charAt(0);
if (firstChar === '#') {
return d.querySelector(e);
} else if (firstChar === '.') {
return d.querySelectorAll(e);
View javascript-and-drupal.js
* @file
* Always start with a brief, one-line description of the script.
* If more than one line is needed to describe the script, provide more detailed
* comment text following a blank comment line.
// Use an IIFE (immediately invoked function expression) to encapsulate your
// script from other scripts loaded on the page and to prevent pollution of the
// global namespace.
View .git-commit-template.txt
# [Title] Capitalized, short (50 chars or less) summary, write message in imperative
# [Body] Detailed explanation (72 chars or less), can make usage of markdow, bullet lists...
# [Number/Ticket/Issue] References to issues solved
guillaumepiot / gist:5585590
Last active Dec 5, 2016
jQuery - YouTube video play/stop on modal open/hide
View gist:5585590
$('#video').modal({'show':true}).on('hidden', function () {
erichonorez / rest_api.js
Created Feb 10, 2013
A simple REST API with Node.js and Express
View rest_api.js
* TaskRepository class deals with task persistence
function TaskRepository() {
this.tasks = [];
this.nextId = 1;
* Find a task by id
* Param: id of the task to find
vitorbritto /
Last active Aug 1, 2018
Major dependencies that I use on Grunt, Gulp, Bower, Karma and Node/CLI.
hullen / mobileCheck.js
Last active Mar 6, 2020
Detects mobile devices: phones, tablets. mobileCheck is a lightweight Javascript utils for detecting mobile devices and tablets. Its using User Agent string. Usage: if ( mobileCheck.smarphone ) { // Code }
View mobileCheck.js
var mobileCheck = {
ios: (function(){
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
android: (function(){
return navigator.userAgent.match(/Android/i);
blackBerry: (function(){
return navigator.userAgent.match(/BB10|Tablet|Mobile/i);
ljharb /
Last active May 16, 2020
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.


JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

kosamari /
Last active May 16, 2020
ServiceWorker for github pages.

ServiceWorker for github pages

This is a ServiceWorker template to turn small github pages into offline ready app.

Why ?

Whenever I make small tools & toys, I create github repo and make a demo page using github pages (like this one).
Often these "apps" are just an index.html file with all the nessesary CSS and JavaScript in it (or maybe 2-3 html/css/js files). I wanted to cache these files so that I can access my tools offline as well.


Make sure your github pages have HTTPS enforced, you can check Settings > GitHub Pages > Enforce HTTPS of your repository.

orther / index.js
Created Jan 27, 2017
A few simple examples of sorting with Ramda's sortBy function.
View index.js
import R from 'ramda';
const items = [
{id: 1, name: 'Al', country: 'AA'},
{id: 2, name: 'Connie', country: 'BB'},
{id: 3, name: 'Doug', country: 'CC'},
{id: 4, name: 'Zen', country: 'BB'},
{id: 5, name: 'DatGGboi', country: 'AA'},
{id: 6, name: 'Connie', country: 'AA'},
You can’t perform that action at this time.