Skip to content

Instantly share code, notes, and snippets.

View nramirez's full-sized avatar
lion mode!

Naz nramirez

lion mode!
View GitHub Profile
class Thing {
constructor(name) {
this.name = name;
this.__lookupGetter__ = (n) => this[n];
this.is_a = new Proxy(this, {
get: (target, name) => {
if (typeof n === 'symbol') {
return target[n];
}
const propName = `is_a_${name}`;
@nramirez
nramirez / LinkedInConnectionsRemover.ts
Last active September 2, 2019 18:57
Delete linkedin connections faster
// Paste this code in https://www.linkedin.com/mynetwork/invite-connect/connections/
// and save 2 clicks when trying to delete a connection
let deleteFriend = () => {
$('.mn-connection-card__dropdown-option-text').click();
setTimeout($('button[data-control-name=confirm_removed]').click(), 500);
};
let handlePointsClick = () => {
setTimeout(deleteFriend , 200);
};
@nramirez
nramirez / .gitconfig
Last active November 29, 2023 15:40
.gitconfig
[user]
name = Tu Nombre
email = Tu Correo
[color]
branch = auto
diff = auto
status = auto
ui = true
interactive = auto
[help]
@nramirez
nramirez / longest-increasing-subsecuence.js
Created October 6, 2017 12:50
Longest increasing subsecuence
let highest = [];
longest = (sequence) => {
var ordered = sequence.map(n => n);
ordered.sort((a, b) => a - b);
var matrix = {};
const length = ordered.length;
for (let i = 0; i < length; i++) {
for(let j = 0; j < length; j++) {
@nramirez
nramirez / gulpfile.babel.js
Last active August 17, 2016 12:34
ES6, Gulp, Browserify and React
'use strict';
import source from 'vinyl-source-stream';
import gulp from 'gulp';
import browserify from 'browserify';
import babelify from 'babelify';
import run from 'run-sequence';
import rimraf from 'rimraf';
import shell from 'gulp-shell';
import server from 'gulp-live-server';
@nramirez
nramirez / .babelsrc
Created January 10, 2016 08:50
Gulp, Babel, React and Expressjs
{
"presets": ["es2015", "stage-0"]
}
//This will allow you to use ES6 in the gulpfile
@nramirez
nramirez / playlist.jsx
Last active January 9, 2016 18:51
Wedding playlist
var data = [];
var playlist = React.createClass({
getInitialState: function(){
return { lastSong: 0 }
},
componentDidMount: function() {
setInterval(this.loadSongs, 5000);
},
loadSongs: function() {
@nramirez
nramirez / javascript_resources.md
Last active August 29, 2015 14:14 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@nramirez
nramirez / gist:0c274c9c101114555eea
Last active August 29, 2015 14:14
Complex CSV Parser
function parseCSV(input, separator, quote) {
separator = separator || ',';
quote = quote || '"';
var tempWord ='', c ='', temp = [],
closingPosition, result =[], specialCharacters = '$\\',
doubleQuoteRegex = new RegExp(quote+quote, 'g');
if (specialCharacters.indexOf(quote) > -1) {
doubleQuoteRegex = new RegExp('\\' +quote+ '\\' +quote, 'g');
};
@nramirez
nramirez / gist:f7729ff768657b85d60d
Last active August 29, 2015 14:14
Sum of (Two) Squares
var allSquaredPairs = function(n){
var max = Math.sqrt(n),
posibles = [],
temp =0,
result = [],
i =0;
for(; i<=max; i++)
{
//Reference http://stackoverflow.com/questions/5380323/whats-the-fastest-algorithm-to-represent-a-prime-as-sum-of-two-squares
temp = Math.sqrt(n-i*i);