Legend:
- ✏️ method changes
this
. - 🔒 method does not change
this
.
Array<T>.prototype.*
:
concat(...items: Array: T[]
🔒 ES3
/** | |
* This mixin is forked from talented Hugo Giraudel | |
* Mixin to put items on a circle | |
* [1] - Allows children to be absolutely positioned | |
* [2] - Allows the mixin to be used on a list | |
* [3] - In case box-sizing: border-box has been enabled | |
* [4] - Allows any type of direct children to be targeted | |
// element indexes should be written to the DOM either via backend or JS | |
$('.circle-container').children().each(function() { |
// mobile viewport bug with `100vh` in WebKit (iOS Safari)! | |
// credits: https://twitter.com/AllThingsSmitty/status/1254151507412496384 | |
body { | |
min-height: 100vh; | |
min-height: -webkit-fill-available; | |
} | |
html:focus-within { | |
scroll-behavior: smooth; | |
} |
# To recursively give directories read&execute privileges: | |
find /path/to/base/dir -type d -exec chmod 755 {} + | |
# To recursively give files read privileges: | |
find /path/to/base/dir -type f -exec chmod 644 {} + | |
# Or, if there are many objects to process: | |
chmod 755 $(find /path/to/base/dir -type d) | |
chmod 644 $(find /path/to/base/dir -type f) |
python | |
>>> import urllib2 | |
>>> p = urllib2.urlopen("http://www.google.com") | |
>>> c = p.read() | |
>>> c | |
>>> dir(p) | |
>>> exx = p.geturl() | |
>>> exx | |
'http://www.google.com.tr/?gfe_rd=cr&ei=77OxVof4Hqyo8we8qoyADw' | |
>>> p.headers.items() |
// random numbergenerator between 0 and 1 | |
var randomNum = ((Math.random() * 2) | 0) + 1 - 1; | |
// same memoize function from before | |
const memoize = (fn) => { | |
let cache = {}; | |
return (...args) => { | |
let n = args[0]; | |
if (n in cache) { | |
console.log('Fetching from cache', n); |
// 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'; |
None of the string methods modify this
– they always return fresh strings.
charAt(pos: number): string
ES1
Returns the character at index pos
, as a string (JavaScript does not have a datatype for characters). str[i]
is equivalent to str.charAt(i)
and more concise (caveat: may not work on old engines).
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ | |
"key": "ctrl+alt+enter", | |
"command": "editor.emmet.action.wrapWithAbbreviation" | |
}, | |
{ | |
"key": "ctrl+shift+oem_2", | |
"command": "editor.action.blockComment", | |
"when": "editorFocus" |
// original code: https://github.com/AnthumChris/fetch-progress-indicators | |
const element = document.getElementById('progress'); | |
fetch('url') | |
.then(response => { | |
if (!response.ok) { | |
throw Error(response.status+' '+response.statusText) | |
} |