Skip to content

Instantly share code, notes, and snippets.

View nescalante's full-sized avatar
🐢

Nicolas Escalante nescalante

🐢
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nescalante on github.
  • I am nescalante (https://keybase.io/nescalante) on keybase.
  • I have a public key ASC3oFjYocyI4u00eWZah9r6j39GwjHosiOYn-hG04IC-Ao

To claim this, I am signing this object:

@nescalante
nescalante / Emojis.md
Last active October 5, 2017 15:22
Emojis cheatsheet

👶 Small change

♻️ Code is now updated

🐘 Unneeded newline

💇 Refactor here

🐩 Caution

@nescalante
nescalante / foo.html
Created July 26, 2017 18:41
api notebook example
<div id="root"></div>
<script src="https://api-notebook.anypoint.mulesoft.com/scripts/embed.js"></script>
<script>
var exec = [
'App.middleware.register(\'persistence:change\', function (notebook, next, done) {',
' App.postMessage.trigger(\'persistence:change\', {',
' meta: notebook.meta,',
' content: notebook.content',
' });',
' return done();',
@nescalante
nescalante / cssdebug.js
Created September 27, 2016 13:48
CSS Debugger
[].forEach.call($$("*"),(a)=>{if(a.style)a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})
@nescalante
nescalante / getElementsByClassName.js
Created January 8, 2015 16:10
Polyfill for getElementsByClassName
if (!document.getElementsByClassName) {
document.getElementsByClassName = function(search) {
var d = document, elements, pattern, i, results = [];
if (d.querySelectorAll) { // IE8
return d.querySelectorAll("." + search);
}
if (d.evaluate) { // IE6, IE7
pattern = ".//*[contains(concat(' ', @class, ' '), ' " + search + " ')]";
elements = d.evaluate(pattern, d, null, 0, null);
while ((i = elements.iterateNext())) {
@nescalante
nescalante / affirmation
Created December 11, 2014 21:56
MuleSoft Contributor Agreement Acceptance by Nicolas Escalante
I, Nicolas Escalante, have read and do accept the MuleSoft Contributor Agreement
at http://www.mulesoft.org/legal/contributor-agreement.html
Accepted on Thu Dec 11 2014 18:56:55 GMT-0300 (Argentina Standard Time)
@nescalante
nescalante / SP_RunScript.sql
Created July 24, 2014 13:29
RunScript Stored Procedure
IF ( OBJECT_ID('dbo.RunScript') IS NOT NULL )
DROP PROCEDURE dbo.RunScript
GO
CREATE PROCEDURE dbo.RunScript
@scriptUrl nvarchar(max)
AS
BEGIN
SET NOCOUNT ON
SET @scriptName = '$(fileName)'
DECLARE @count int
select @count = count(Name) from Script where Name = @scriptName and RanOk = 1
IF (@count = 0)
BEGIN
BEGIN TRY
BEGIN TRANSACTION
@nescalante
nescalante / container.js
Created July 23, 2014 17:41
container.js
var container = (function() {
var instances = {};
return {
set: function (key, value) {
instances[key] = value;
},
get: function (key) {
return instances[key]
}
@nescalante
nescalante / array-batch.js
Last active August 29, 2015 13:58
Array batch execution
function batch(array, size, callback, done) {
var index = 0,
processed = 0;
while (index < size) {
next();
}
function next() {
var item = array[index];