Hola
- Add or remove caret:
Alt + Left Click- Useful to write at multiple places at once
- Choose lookup Item replace:
Ctrl + Enter
- Complete and replace
| millisecondsToHMS: (ms) -> | |
| hms = { | |
| h: Math.floor(ms/(60*60*1000)), | |
| m: Math.floor((ms/60000) % 60), | |
| s: Math.floor((ms/1000) % 60) | |
| } | |
| tc = [] | |
| tc.push(hms.h) if (hms.h > 0) | |
| m = hms.m; |
| JSON: | |
| parse: (string) -> | |
| if string[0] != "{" && string[0] != "[" | |
| return null | |
| else if window.JSON? | |
| window.JSON.parse(string) | |
| else | |
| eval(string) |
| beforeEach(function() { | |
| this.addMatchers({ | |
| toBeInstanceOf: function(expectedInstance) { | |
| var actual = this.actual; | |
| var notText = this.isNot ? " not" : ""; | |
| this.message = function() { | |
| return "Expected " + actual.constructor.name + notText + " is instance of " + expectedInstance.name; | |
| }; | |
| return actual instanceof expectedInstance; | |
| } |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| .config(function ($provide) { | |
| 'use strict'; | |
| $provide.decorator('ngSwitchWhenDirective', function ($delegate) { | |
| angular.forEach($delegate, function (ngSwitchWhen) { | |
| // override default compile method since it has already closed over | |
| // the directive definition's link function | |
| ngSwitchWhen.compile = function () { |
| require 'ipaddr' | |
| # Builtin | |
| def ip_to_int32(ip) | |
| x = IPAddr.new(ip).to_i | |
| end | |
| def ip_to_int32(ip) | |
| ip.split( '.' ).reduce( 0 ) { |total, p| total * 256 + p.to_i } |
| APP.getImage = function() { | |
| var r = new XMLHttpRequest(); | |
| r.open('GET', 'https://source.unsplash.com/category/nature/100x100', true); | |
| r.responseType = 'arraybuffer'; | |
| r.onreadystatechange = function(){ | |
| if(this.readyState === XMLHttpRequest.DONE){ | |
| if (this.status === 200) { |
| -- Remove the history from | |
| rm -rf .git | |
| -- recreate the repos from the current content only | |
| git init | |
| git add . | |
| git commit -m "Initial commit" | |
| -- push to the github remote repos ensuring you overwrite history | |
| git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git |