Skip to content

Instantly share code, notes, and snippets.

View LuisRBarreras's full-sized avatar

Luis R Barreras LuisRBarreras

View GitHub Profile
@LuisRBarreras
LuisRBarreras / tasks.json
Created September 7, 2022 23:20 — forked from grabbou/tasks.json
A simple example of launching two long-running processes within Visual Studio Code to make working in monorepo easier
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Expo dev server",
"type": "shell",
"command": "cd ./apps/mobile && yarn start",
"presentation": {
"reveal": "always",
"panel": "new",
const gridSize = 8;
for(i=1; i <= gridSize; i++) {
let times = Math.floor(gridSize / 2);
if(i % 2 === 1) console.log(' *'.repeat(times))
else console.log('* '.repeat(times))
}
@LuisRBarreras
LuisRBarreras / index.html
Created July 25, 2019 14:16
JS Bin Redux Course // source https://jsbin.com/someqil
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Redux Course">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bonsai/0.4/bonsai.min.js"></script>
@LuisRBarreras
LuisRBarreras / git myblame
Last active September 12, 2017 21:30
Use git myblame -- file/path || Thanks to andrewray
git config --global alias.myblame 'log -p -M --follow --stat'
var requestObject = function(options){
function ajax() {
return $.ajax({
method: method,
url: options.url,
data: data,
dataType: 'json'
}).done(options.doneCallback).fail(options.failCallback);
};
return {ajax: ajax};
function Bulk(){
var foo = '';
function getFoo(){
return foo;
}
function setFoo(newFoo){
foo = newFoo;
}
}
function Bulk(){
var foo = '';
function getFoo(){
return foo;
}
function setFoo(newFoo){
foo = newFoo;
}
}
@LuisRBarreras
LuisRBarreras / .ackrc
Last active August 4, 2017 18:11
Ack ignore for NodeJS Project
--ignore-dir=node_modules/
--ignore-dir=coverage/
--ignore-dir=dist/
--ignore-dir=server/tests
@LuisRBarreras
LuisRBarreras / react_redux_container_component.js
Last active May 6, 2017 00:06
React Redux Container Component Template
import React, {PropTypes} from 'react';
import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
class ${NAME} extends React.Component {
constructor(props, context) {
super(props, context);
}
render() {
@LuisRBarreras
LuisRBarreras / recursive_staircase.py
Last active April 11, 2017 17:19
Davis has staircases in his house and he likes to climb each staircase 1, 2 or 3 steps at a time. Being a very precocious child, he wonders how many ways there are to reach the top of the staircase.
def recursive_staircase(height):
steps = [1,2,3]
ways = 0
for step in steps:
if step == height:
ways += 1
break
elif step < height:
ways += recursive_staircase(height - step)