To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
| var socket = null; | |
| function bootstrap() { | |
| // 適当な図形を描画 | |
| var c = document.getElementById('mycanvas'); | |
| var ctx = c.getContext('2d'); | |
| ctx.globalalpha = 0.3; | |
| for(var i=0; i<1000; i++) { | |
| ctx.beginPath(); |
| // Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
| // Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
| var FORMAT_ONELINE = 'One-line'; | |
| var FORMAT_MULTILINE = 'Multi-line'; | |
| var FORMAT_PRETTY = 'Pretty'; | |
| var LANGUAGE_JS = 'JavaScript'; | |
| var LANGUAGE_PYTHON = 'Python'; |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| // -------------------------------------------------- | |
| // Flexbox LESS mixins | |
| // The spec: http://www.w3.org/TR/css3-flexbox | |
| // -------------------------------------------------- | |
| // Flexbox display | |
| // flex or inline-flex | |
| .flex-display(@display: flex) { | |
| display: ~"-webkit-@{display}"; | |
| display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
| //... | |
| files = [ | |
| JASMINE, | |
| JASMINE_ADAPTER, | |
| 'main/webapp/app/lib/jquery-1.8.1.js', | |
| 'main/webapp/app/lib/jquery.autotab-1.1b.js', | |
| 'main/webapp/app/lib/jquery.placeholder.min.js', | |
| 'main/webapp/app/lib/date.js', | |
| 'main/webapp/app/lib/angular/angular.js', |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>| /* | |
| Cross-browser (including IE8-10) | |
| Más info: http://coding.smashingmagazine.com/2013/08/09/absolute-horizontal-vertical-centering-css/ | |
| */ | |
| .absolute-center { | |
| /* height: must be declared */ | |
| margin: auto; | |
| position: absolute; | |
| top: 0; left: 0; bottom: 0; right: 0; | |
| } |
| /** | |
| * Simple authentication and authorization example with passport, node_acl, | |
| * MongoDB and expressjs | |
| * | |
| * The example shown here uses local userdata and sessions to remember a | |
| * logged in user. Roles are persistent all the way and applied to user | |
| * after logging in. | |
| * | |
| * Usage: | |
| * 1. Start this as server |
| function extractColumn(arr, column) { | |
| function reduction(previousValue, currentValue) { | |
| previousValue.push(currentValue[column]); | |
| return previousValue; | |
| } | |
| return arr.reduce(reduction, []); | |
| } |