Skip to content

Instantly share code, notes, and snippets.

View jmonterroso's full-sized avatar

Jayson Monterroso jmonterroso

View GitHub Profile
provider "aws" {
version = "~> 2.0"
region = "eu-west-2"
}
# Providing a reference to our default VPC
resource "aws_default_vpc" "default_vpc" {
}
# Providing a reference to our default subnets

Quick Tip: How to Work with GitHub and Multiple Accounts

by Jeffrey Way

So you have a personal GitHub account; everything is working perfectly. But then, you get a new job, and now need to have the ability to push and pull to multiple accounts. How do you do that? I'll show you how!

Step 1 - Create a New SSH Key

We need to generate a unique SSH key for our second GitHub account.

ssh-keygen -t rsa -C "your-email-address"
@jmonterroso
jmonterroso / post-curl
Created August 9, 2017 18:05 — forked from creativepsyco/post-curl
POST request Via CURL in MAC OS X
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"userid": "mohit", "password":"password"}' http://mmedwebdemo.ddns.comp.nus.edu.sg:8080/comp.nuhs.jaxb/api/usr/login
@jmonterroso
jmonterroso / Katas.md
Last active August 4, 2017 18:14
Katas Solve

All Katas solved and snippets

Format number to currency

ES 6

let formatMoney = (amount) => `$${amount.toFixed(2)}`

Take a Ten Minute Walk

You live in the city of Cartesia where all roads are laid out in a perfect grid. You arrived ten minutes too early to an appointment, so you decided to take the opportunity to go for a short walk. The city provides its citizens with a Walk Generating App on their phones -- everytime you press the button it sends you an array of one-letter strings representing directions to walk (eg. ['n', 's', 'w', 'e']). You know it takes you one minute to traverse one city block, so create a function that will return true if the walk the app gives you will take you exactly ten minutes (you don't want to be early or late!) and will, of course, return you to your starting point. Return false otherwise.

// Highcharts CheatSheet Part 1.
// Create interactive charts easily for your web projects.
// Download: http://www.highcharts.com/download
// More: http://api.highcharts.com/highcharts
// 1. Installation.
// Highcharts requires two files to run, highcharts.js and either jQuery, MooTools or Prototype or the Highcharts Standalone Framework which are used for some common JavaScript tasks.
// <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
// <script src="https://code.highcharts.com/highcharts.js"></script>
@jmonterroso
jmonterroso / add_admin_wp_user.sql
Last active May 5, 2017 05:43
Add admin user to wordpres using a mysql wordpress query
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`)
VALUES ('newadmin', MD5('admin'), 'firstname lastname', 'email@example.com', '0');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`)
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10');
@jmonterroso
jmonterroso / LICENSE
Created June 7, 2016 18:26 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@jmonterroso
jmonterroso / templates.md
Last active February 24, 2016 18:33
live templates intellij

Copy the code for live templates in the following path, saving as xml file:

/Users/jaysonmonterroso/Library/Preferences/IntelliJIdea15/templates

<templateSet group="JavaScript">
  <template name="forin" value="for (var $VAR$ in $ARRAY$) {&#10;  $END$&#10;}" description="Iterate (for..in)" toReformat="true" toShortenFQNames="true">
    <variable name="ARRAY" expression="jsArrayVariable()" defaultValue="&quot;array &quot;" alwaysStopAt="true" />
    <variable name="VAR" expression="jsSuggestVariableName()" defaultValue="&quot;o&quot;" alwaysStopAt="true" />
    <context>
@jmonterroso
jmonterroso / SycAtom.md
Created February 8, 2016 17:00
Sync Atom Packages

Sync Atom across different computers

Star your favorite packages or installed packages


apm star --installed 

stanceApp.directive('ccNumberValidator', function () {
/*
^(?:4[0-9]{12}(?:[0-9]{3})? # Visa
| 5[1-5][0-9]{14} # MasterCard
| 3[47][0-9]{13} # American Express
| 6(?:011|5[0-9]{2})[0-9]{12} # Discover
)$
*/
return {
require: 'ngModel',