How to use packages that depend on Node.js core modules in React Native.
See the [node-libs-react-native][node-libs-react-native] library as a convenience for implementing this method.
class Example { | |
@observable private _name; | |
private counter = 0; | |
@computed | |
get name(): string { | |
return this._name; | |
} | |
set name(value: string) { |
-- A global variable for the Hyper Mode | |
k = hs.hotkey.modal.new({}, "F17") | |
-- Trigger existing hyper key shortcuts | |
k:bind({}, 'm', nil, function() hs.eventtap.keyStroke({"cmd","alt","shift","ctrl"}, 'm') end) | |
-- OR build your own | |
launch = function(appname) |
# GIT heart FZF | |
# ------------- | |
is_in_git_repo() { | |
git rev-parse HEAD > /dev/null 2>&1 | |
} | |
fzf-down() { | |
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@" | |
} |
import { observable, computed } from 'mobx'; | |
import { observer } from "mobx-react"; | |
class BookList { | |
@observable books = [] | |
@computed get readBooks(){ | |
return this.books.filter(b => b.isRead); | |
} | |
loadBooks(){ | |
setTimeout(() => { |
=TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",100)),99)) |
var assert = require('assert') | |
var sinon = require('sinon') | |
var dependency = require('dependency') | |
var sut = require('./injection-sut') | |
describe('sut', function () { | |
var methodStub | |
beforeEach(function () { | |
methodStub = sinon.stub(dependency, 'method') |
That’s one of the real strengths of Docker: the ability to go back to a previous commit. The secret is simply to docker tag the image you want. | |
Here’s an example. In this example, I first installed ping, then committed, then installed curl, and committed that. Then I rolled back the image to contain only ping: | |
$ docker history imagename | |
IMAGE CREATED CREATED BY SIZE | |
f770fc671f11 12 seconds ago apt-get install -y curl 21.3 MB | |
28445c70c2b3 39 seconds ago apt-get install ping 11.57 MB | |
8dbd9e392a96 7 months ago 131.5 MB |
Source: http://willandorla.com/will/2011/01/convert-folder-into-git-submodule/
$ git clone --no-hardlinks original-repo copied-repo
#!/bin/sh | |
# Get MacOSX idletime. Shamelessly stolen from http://bit.ly/yVhc5H | |
/usr/sbin/ioreg -c IOHIDSystem | /usr/bin/awk '/HIDIdleTime/ {print int($NF/1000000000); exit}' |