docker exec -t -i b5ae54373681 /bin/bash
docker cp b5ae54373681:app ~/app-b5ae54373681
scp -r vagrant@10.0.0.2:/home/vagrant/app-b5ae54373681 ~/app-b5ae54373681
| {Component, Device} = require "modx" | |
| hexToRgb = require "hex-rgb" | |
| type = Component "OuterBorder" | |
| type.defineProps | |
| style: Style | |
| child: Element |
| global.getParentView = do -> | |
| ReactInstanceMap = require "ReactInstanceMap" | |
| return (view, level = 1) -> | |
| unless view._reactInternalInstance | |
| view = view._currentElement._owner._instance | |
| parent = ReactInstanceMap.get view | |
| while parent and --level >= 0 |
| #!/bin/bash | |
| read_lines() { | |
| while IFS='' read -r line || [[ -n $line ]]; do | |
| if [ -z "${line// }" ] || [[ $line == "#"* ]]; then continue; fi | |
| echo "$line" | |
| done < "$1" | |
| } | |
| if [ -f "$1" ]; then read_lines "$@"; fi |
| description "Dokku app redeploy fix service" | |
| start on started dokku-reploy | |
| exec start-stop-daemon --start -c dokku --exec /usr/bin/dokku-redeploy-fix |
Build the native binding of a NodeJS library for multiple platforms/versions.
With no arguments, this script use the nearest node-gyp installation to build binding.gyp for the version of node being used. Then it looks for binding.node in the resulting build/Release directory, and copies it into the vendor directory (created on-the-fly). You will find it inside a subdirectory named ${process.platform}-${process.arch}-${moduleVersion}.
When --target or --version are undefined, this script resolves their values for you.
NOTE: You must specify --version if you specify --target as a version not currently used by your shell.
After building the native binding, you can npm rm bindings and use the provided binding.js module for loading your native binding with require. The binding.js module is smart enough to know which vendor subdirectory contains the appropriate binding for the current process.
| const capsRE = /([A-Z])/g; | |
| const $styles = $('<style>').appendTo(document.head); | |
| exports.addRule = function(selector, style) { | |
| $styles.append(formatRule(selector, style)); | |
| }; | |
| function formatRule(selector, style) { |
const styles = require('./styles')
const promise = styles.onLoad('foo.css', 'bar.css')
promise.then(() => {
console.log('Stylesheets loaded!')
// Now, measurements can be done safely!
})| /* | |
| * Your Stylesheet | |
| * | |
| * This stylesheet is loaded when Atom starts up and is reloaded automatically | |
| * when it is changed. | |
| * | |
| * If you are unfamiliar with LESS, you can read more about it here: | |
| * http://www.lesscss.org | |
| */ |
| // @flow | |
| export type Deferred<T> = { | |
| promise: Promise<T>, | |
| resolve: (value: T) => void, | |
| reject: (error: Error) => void, | |
| } | |
| export function defer(): Deferred<any> { | |
| const deferred = {} |