Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jaime Pericas jaimefps

🏠
Working from home
  • Portland , OR
View GitHub Profile
@jaimefps
jaimefps / yaml-sorter.js
Last active Apr 29, 2020
Sort root level keys on a Yaml string or Yaml file.
View yaml-sorter.js
fs = require("fs");
yaml = require("yamljs");
// Sort root level keys on a JS object.
function sortKeys(obj, promote = [], demote = [], sorter) {
const sorted = {};
promote.forEach((k) => (sorted[k] = obj[k]));
Object.keys(obj)
@jaimefps
jaimefps / .gitignore
Created Jan 2, 2020 — forked from ericelliott/.gitignore
Sample Node project .gitignore
View .gitignore
node_modules
build
npm-debug.log
.env
.DS_Store
@jaimefps
jaimefps / index.html
Created Dec 7, 2019 — forked from chrisvfritz/index.html
Simplest possible HTML template
View index.html
<!doctype html>
<html>
<head>
<title>This is the title of the webpage!</title>
</head>
<body>
<p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p>
</body>
</html>
View keyforgev1.cpp
#include <Adafruit_RGBLCDShield.h>
// globals:
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
int counter = 0;
int currentButtons;
int currentPlayer = 1;
int currentStat = 0;
int cursor = 0;
int lastButton;
View gist:9af5b934f41294a6344791f94221afd1
var letArray = ['a', 'b', 'c'];
var numArray = [1, 2, 3, 4, 5];
function mergeArrays(arrayA, arrayB) {
var smallArray = [];
var bigArray = [];
if(arrayA.length < arrayB.length) {
smallArray = arrayA;
View gist:5cba51380c933c410acf206cc84f5587
var book = [
{
title: 'parte 1',
definitions: ['por causa de si ...', 'se llama finita en su genero ...'],
references: []
},
{
title: 'parte 2 (importante)',
definitions: ['definition parte 2 def 1', 'aqui hay otra cosa'],
references: [{
View gist:08214493ebc0e4baadd431c77fb01055
var calendar = {
Monday: {9: null,10:null, 11:null, 12:null, 1:null, 2:null},
Tuesday:{9: null,10:null, 11:null, 12:null, 1:null, 2:null},
Wedneday:{9: null,10:null, 11:null, 12:null, 1:null, 2:null},
Thursday:{9: null,10:null, 11:null, 12:null, 1:null, 2:null}
};
var addDogToCalendar = function(day, hour, dogName) {
calendar[day][hour] = dogName;
};