http://jilles.me/badassify-your-terminal-and-shell/
wget https://raw.githubusercontent.com/rupa/z/master/z.sh -O ~/z.sh
echo . /path/to/z.sh >> ~/.bashrc
echo . /path/to/z.sh >> ~/.zshrc
http://jilles.me/badassify-your-terminal-and-shell/
wget https://raw.githubusercontent.com/rupa/z/master/z.sh -O ~/z.sh
echo . /path/to/z.sh >> ~/.bashrc
echo . /path/to/z.sh >> ~/.zshrc
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| 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', |
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$) { $END$ }" description="Iterate (for..in)" toReformat="true" toShortenFQNames="true">
<variable name="ARRAY" expression="jsArrayVariable()" defaultValue=""array "" alwaysStopAt="true" />
<variable name="VAR" expression="jsSuggestVariableName()" defaultValue=""o"" alwaysStopAt="true" />
<context>
| 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: |
| INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`) | |
| VALUES ('newadmin', MD5('admin'), 'firstname lastname', '[email protected]', '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'); | |
| // 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> |
ES 6
let formatMoney = (amount) => `$${amount.toFixed(2)}`
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.