Skip to content

Instantly share code, notes, and snippets.

Antonio Caputo sulaqo

Block or report user

Report or block sulaqo

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
sulaqo /
Created Apr 16, 2018 — forked from addyosmani/
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

sulaqo / functional-utils.js
Created Mar 20, 2018 — forked from bendc/functional-utils.js
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
View functional-utils.js
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
sulaqo / jQvalidate.html
Created Jan 22, 2018 — forked from vishnukumarpv/jQvalidate.html
Declaring jQuery Validate plugin rules inline
View jQvalidate.html
<input type="text" name="email" data-rule-required="true" data-rule-email="true">
<input type="text" name="password" id="passoword" data-rule-required="true" data-rule-minlength="6">
<input type="text" name="password-confirm" data-rule-required="true" data-rule-minlength="6" data-rule-equalsto="#password">
<input id="cemail" name="email" data-rule-required="true" data-rule-email="true" data-msg-email="Please enter a valid email address" />
(Tested, core)
sulaqo / signRequest.pseudo_code
Created Sep 10, 2017 — forked from SeanHayes/signRequest.pseudo_code
Pseudo code for signing OAuth requests
View signRequest.pseudo_code
function urlEncode(str){
//everything except [a-zA-Z0-9-_~.] must be percent encoded:
function hmac_sha1(key, text){
//you'll definitely want a library for this. I used Crypto-JS:
function base64me(key, text){
//I used Crypto-JS for this too.
sulaqo / httpWrapper.js
Created Apr 12, 2017 — forked from victormejia/httpWrapper.js
Simple $http wrapper in AngularJS
View httpWrapper.js
.factory('AppSvc', function ($http, $q) {
return {
ajaxRq: function (req, cb) {
var deferred = $q.defer();
.success(function (data, status, headers, cfg) {
if (cb) {
status: status,
sulaqo / api.js
Created Apr 12, 2017 — forked from atuttle/api.js
Angular.js REST API Service Wrapper
View api.js
app.factory('API', function($http, $q){
var basePath = '';
// =>
function makeRequest(verb, uri, data){
var defer = $q.defer();
verb = verb.toLowerCase();
//start with the uri
sulaqo / gulpfile.js
Last active Mar 3, 2017
Sample Gulpfile SASS+ ImageMin + Watch
View gulpfile.js
// For development => gulp
// For production => gulp -p
// Call Plugins
var env = require('minimist')(process.argv.slice(2)),
gulp = require('gulp'),
uglify = require('gulp-uglify'),
compass = require('gulp-compass'),
concat = require('gulp-concat'),
cssmin = require('gulp-cssmin'),

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
sulaqo / gist:fac87526d2dc60dc9305
Created Jan 10, 2016 — forked from Mithrandir0x/gist:3639232
Difference between Service, Factory and Provider in AngularJS
View gist:fac87526d2dc60dc9305
// Source:!topic/angular/hVrkvaHGOfc
// jsFiddle:
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
You can’t perform that action at this time.