Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+โง+K | delete line |
Ctrl+โฉ | insert line after |
#### Launching other programs using python | |
You can launch other program using `Popen()` function present in built in `subprocess()` module. | |
To start an external progra, from your python script,pass filename to subprocess.Popen() | |
For example | |
``` | |
>>> import subprocess | |
>>> subprocess.Popen('C:\\Windows\\System32\\calc.exe') | |
``` |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+โง+K | delete line |
Ctrl+โฉ | insert line after |
/* Polyfill indexOf. */ | |
var indexOf; | |
if (typeof Array.prototype.indexOf === 'function') { | |
indexOf = function (haystack, needle) { | |
return haystack.indexOf(needle); | |
}; | |
} else { | |
indexOf = function (haystack, needle) { | |
var i = 0, length = haystack.length, idx = -1, found = false; |
To perform server-side rendering, use renderStatic
from glamor, which takes a callback. Render your component inside the callback and all of the calls to css()
will be collected and generated html and css will be returned. This will also return an array of ids to rehydrate the styles for fast startup.
To perform rehydration, call rehydrate
with the array of ids returned by renderStatic
.
Example -
import { renderStatic } from 'glamor/server';
'use strict'; | |
/*****************NATIVE forEACH*********************/ | |
Array.prototype.myEach = function(callback) { | |
for (var i = 0; i < this.length; i++) | |
callback(this[i], i, this); | |
}; | |
//tests |
// @flow | |
type A11yOptionsStatusMessageOptions = { | |
highlightedIndex: number, | |
highlightedValue: any, | |
inputValue: string, | |
isOpen: boolean, | |
itemToString: (item: any) => string, | |
previousResultCount: number, | |
resultCount: number, |
/* | |
Jimp v0.2.28 | |
https://github.com/oliver-moran/jimp | |
Ported for the Web by Phil Seaton | |
The MIT License (MIT) | |
Copyright (c) 2014 Oliver Moran | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal |
class App extends React.Component { | |
state = { src: '', err: null } | |
render() { | |
return ( | |
<ProcessImage | |
image='http://365.unsplash.com/assets/paul-jarvis-9530891001e7f4ccfcef9f3d7a2afecd.jpg' | |
colors={{ | |
mix: { | |
color: 'mistyrose', |
if(Function.prototype.name===undefined&&Object.defineProperty!==undefined){Object.defineProperty(Function.prototype,"name",{get:function(){var regex=/function\s([^(]{1,})\(/,match=regex.exec(this.toString());return match&&match.length>1?match[1].trim():""}})}if(String.prototype.trimRight===undefined){String.prototype.trimRight=function(){return String(this).replace(/\s+$/,"")}}var stylus=function(){function require(p){var path=require.resolve(p),mod=require.modules[path];if(!mod)throw new Error('failed to require "'+p+'"');if(!mod.exports){mod.exports={};mod.call(mod.exports,mod,mod.exports,require.relative(path))}return mod.exports}var bifs="called-from = ()\n\nvendors = moz webkit o ms official\n\n// stringify the given arg\n\n-string(arg)\n type(arg) + ' ' + arg\n\n// require a color\n\nrequire-color(color)\n unless color is a 'color'\n error('RGB or HSL value expected, got a ' + -string(color))\n\n// require a unit\n\nrequire-unit(n)\n unless n is a 'unit'\n error('unit expected, got a ' + -strin |
let HEAP = []; | |
const A = { | |
language: 'JavaScript' | |
}; | |
HEAP.push(A); | |
const root = () => HEAP[0]; |