Skip to content

Instantly share code, notes, and snippets.

Avatar

Ale Ornelas Figueroa yknx4

View GitHub Profile
@yknx4
yknx4 / colima.kml
Last active Nov 10, 2018
Colima KML
View colima.kml
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Zonas</name>
<Style id="poly-000099-5001-22-nodesc-normal">
<LineStyle>
<color>ff990000</color>
<width>5.001</width>
</LineStyle>
<PolyStyle>
@yknx4
yknx4 / check_circle_for_changes.sh
Created Apr 16, 2018
Checks if there were changes in certain folder to run tests, otherwise halt
View check_circle_for_changes.sh
FOLDER=$1
# Check if there were changes in a folder, otherwise skip tests
npx cifccigcr "${FOLDER}/**/*" "${CIRCLE_COMPARE_URL}"
if [ $? -eq 0 ]; then
echo $FOLDER folder not changed. skipping tests.
circleci step halt
else
echo $FOLDER folder changed. Running tests.
View loggers.md

Loggers

Winston


Personal favorite :)

Pros

  • > 1 million download in the last month (comunnity acceptance)
  • > 2 years in the market.
  • last updated 3 months ago
  • 185 contributors
@yknx4
yknx4 / Javascript.md
Last active Feb 23, 2017
Javascript Pro Tips
View Javascript.md

Javascript Pro-tips

Variables and constants

  • Prefer the use of let and const than var.
    • var should be used mostly in loops, to avoid a new variable each cycle.
    • ex. for (var i = 0; i < 10000; ++i) wil create variable i once, even though each cycle will "redefine" variable i, beacuse of how javascript works, it will just reuse the previous one, and use it for the rest of the loop
    • ex. for (let i = 0; i < 10000; ++i) will create variable i scoped to each cycle. So this will mean it will actually create 10,000 variables, one per cycle.
    • let is preferred because it is scoped to the current block, allowing nested blocks to access it, but preventing from redefining an upper level variable or being accessed from outside of the expected scope.
    • ex. var i = 5; if (i>0) { var i = 10; console.log(i); }; console.log(i); => output: 10, 10 In this example even though a new var was declared in the if block, it just reused the previous one. And so the i on the outer
View settings.js
var settings = {
spinner: {
enabled: false
}
}
if (typeof module != 'undefined') {
module.exports = settings;
}
@yknx4
yknx4 / setup_dynamo.sh
Last active May 1, 2017
Setting up DynamoDB
View setup_dynamo.sh
#!/bin/bash
DYNAMO_DB_TARBALL='dynamodb_local_latest.tar.gz';
LATEST_DYNAMO_URL='https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz';
TARGET_DIR="$HOME/Apps"
DYNAMO_ROOT="$TARGET_DIR/dynamodb"
# Download DynamoDB
if ! test -f $DYNAMO_DB_TARBALL; then
View -
2026, Better Nate Than Ever
3666, Dogboy
9298, Bone Gap
13815, Team Moon: How 400,000 People Landed Apollo 11 on the Moon
2342, Runt
2213, Sahara Special
9506, Conviction
19799, Rhythm Ride: A Road Trip Through the Motown Sound
10478, A Single Pebble
35655, This Broken Wondrous World
View -
[[2026, "Better Nate Than Ever"], [3666, "Dogboy"], [9298, "Bone Gap"], [13815, "Team Moon: How 400,000 People Landed Apollo 11 on the Moon"], [2342, "Runt"], [2213, "Sahara Special"], [9506, "Conviction"], [19799, "Rhythm Ride: A Road Trip Through the Motown Sound"], [10478, "A Single Pebble"], [35655, "This Broken Wondrous World"], [7552, "Enchanted Air: Two Cultures, Two Wings: A Memoir"], [1686, "Mary Tudor \"Bloody Mary\""], [33319, "23 Minutes"], [8277, "A Bitter Magic"], [8076, "The Inker's Shadow"], [2877, "The Twistrose Key"], [35717, "The Heartbreakers"], [2128, "The Underneath"], [9221, "No Pretty Pictures: A Child of War"], [35788, "The Hairdresser of Harare"], [2422, "What I Came to Tell You"], [31506, "Escape! The Story of the Great Houdini"], [9284, "The Boy in the Black Suit"], [9441, "Out of Darkness"], [6650, "Foulsham"], [34727, "Iron Rails, Iron Men and the Race to Link the Nation: The Story of the Transcontinental Railroad"], [1683, "Sorghaghtani of Mongolia"], [6659, "The Octopus Scienti
View Gemfile
source 'https://rubygems.org'
#### RUBY VERSION ####
ruby '2.3.1'
#### RAILS VERSION ####
gem 'rails', '4.1.5'
# TODO: once we migrate to rails 4.2 let's get rid of this gem
gem 'activejob_backport'
View books_cat01.csv
We can't make this file beautiful and searchable because it's too large.
In the banker's bed,"Williams, Cathy."
New Testament words.,"Barclay, William, lecturer in the University of Glasgow."
"Poets, farewell! ","Wilson, Edmund, 1895-1972."
"The world grows round my door; the story of The Kampong, a home on the edge of the tropics,","Fairchild, David, 1869-1954."
"Puerto Rican authors: a biobibliographic handbook,","Hill, Marnesba D."
"Memoirs of the life and services of Daniel Drake, M.D., physician, professor, and author; with notices of the early settlement of Cincinnati. And some of its pioneer citizens.","Mansfield, Edward Deering, 1801-1880."
Final harvest: Emily Dickinson's poems.,"Dickinson, Emily, 1830-1886."
Three times a bridesmaid,"Marsh, Nicola."
Meter means measure: the story of the metric system,"Hirsch, S. Carl."
"Fabulous Hoosier, a story of American achievement,","Fisher, Jane (Watts)"