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

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
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
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
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: http://tools.ietf.org/html/rfc5849#section-3.6
}
function hmac_sha1(key, text){
//you'll definitely want a library for this. I used Crypto-JS: http://code.google.com/p/crypto-js/
}
function base64me(key, text){
//I used Crypto-JS for this too.
}
/*
@sulaqo
sulaqo / httpWrapper.js
Created Apr 12, 2017 — forked from victormejia/httpWrapper.js
Simple $http wrapper in AngularJS
View httpWrapper.js
angular.module('app')
.factory('AppSvc', function ($http, $q) {
return {
ajaxRq: function (req, cb) {
var deferred = $q.defer();
$http(req)
.success(function (data, status, headers, cfg) {
if (cb) {
deferred.resolve(cb({
status: status,
@sulaqo
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 = 'http://domain.com/api/path';
// => http://domain.com/api/path/foo/bar
function makeRequest(verb, uri, data){
var defer = $q.defer();
verb = verb.toLowerCase();
//start with the uri
View rxjs_operators_by_example.md
@sulaqo
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'),
View angularjs_directive_attribute_explanation.md

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
sulaqo / gist:fac87526d2dc60dc9305
Created Jan 10, 2016 — forked from Mithrandir0x/gist:3639232
Difference between Service, Factory and Provider in AngularJS
View gist:fac87526d2dc60dc9305
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// 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.