All these Gist files are explained on my Open API Specification (fka Swagger Specification) tutorial on API Handyman blog.
This tutorial is composed of several posts, here are the posts links and files used for each one:
- Part 1: Introduction
- Part 2: The basics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Initialize an array of x items with undefined values. | |
| //cfr. http://www.2ality.com/2013/11/initializing-arrays.html | |
| var x = 5; | |
| Array.apply(null, Array(x)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Update-ExecutionPolicy Unrestricted | |
| Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
| Enable-RemoteDesktop | |
| cinst Firefox | |
| cinst GoogleChrome | |
| cinst Opera | |
| cinst evernote | |
| cinst skitch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Bitwise operators convert their operands to integers and give integer results. | |
| * This means that a bitwise OR with zero, an otherwise useless operation, converts a value to an integer. | |
| * Credits: http://en.wikipedia.org/wiki/Asm.js#Examples | |
| */ | |
| var notANumber = "5"; | |
| var aNumber = notANumber|0; | |
| console.log(typeof aNumber); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT col_1, COUNT(*) FROM table GROUP BY col_1 HAVING COUNT(*) > 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function pad(string, length, padstring){ | |
| if (!string || !length || !padstring) | |
| throw new Error('all parameters must be defined'); | |
| var outputstr = '' + string, | |
| diff = length - outputstr.length; | |
| if (diff < 1) return string; | |
| var arr = new Array(diff); | |
| arr.push(outputstr); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| python -m SimpleHTTPServer | |
| python -m http.server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require.config({ | |
| baseUrl: "/js/", | |
| urlArgs: 'cb=' + Math.random(), // <<< That's it. | |
| paths: {... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _.templateSettings = { | |
| interpolate: /\<\@\=(.+?)\@\>/gim, | |
| evaluate: /\<\@(.+?)\@\>/gim | |
| }; |
NewerOlder