Represent maps
// rather than
const map: {[ key: string ]: string} = {
foo: 'bar',
}
/Applications/Spotify.app/Contents/Resources/Spotify.sdef
# read-only
osascript -e 'tell application "Spotify" to player state' # stopped,playing,paused
osascript -e 'tell application "Spotify" to current track' # The current playing track.
osascript -e 'tell application "Spotify" to artwork url of current track' # Image data in TIFF format.
osascript -e 'tell application "Spotify" to artist of current track' # The artist of the track.
import React from "react"; | |
import useMutableReducer from "./useMutableReducer"; | |
const reducer = (draft, action, state) => { | |
switch (action) { | |
case "increment": | |
draft.count++; | |
break; | |
case "decrement": | |
draft.count--; |
I have tried a lot of solutions for IP-camera streams.
Vitamio.https://github.com/yixia/Vitamio-iOS
Result: random crashes and not working cameras
https://github.com/kolyvan/kxmovie
Result: compile time error. I haven't successfully integrated it to my project.
GStreamer. https://github.com/sdroege/gst-player
Step-by-step guide for creating a feature or bugfix branch, submit it for code review as a pull request and once approved, merge upstream. This guide is intended for internal developers with push access to all relevant repos.
You should understand rebasing and squashing. For a very good explanation on rebasing and squashing with pull requests see How to Rebase a Pull Request. Also worth reading is the Hacker's Guide to Git.
# -*- mode: python -*- | |
{ | |
"targets": [ | |
{ | |
"include_dirs": ["<!(node -e \"require('nan')\")"], | |
"target_name": "TimerAndPromise", | |
"sources": [ | |
"timer-and-promise.cc" | |
], | |
"conditions": [ |
function Bucket(capacity, level){ | |
this.capacity = capacity; | |
this.level = level || 0; | |
} | |
Bucket.prototype.fill = function(){ | |
this.level = this.capacity; | |
} | |
Bucket.prototype.discard = function(){ | |
this.level = 0; | |
} |
npm install -g jspm@beta
jspm init
jspm install angular2 reflect-metadata zone.js es6-shim
This will create a jspm_packages
folder, and a config.js
file.
Open the config.js
file - this file manages options for the System.js loader - tweak it as appropriate
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
}; | |
NodeList.prototype.__proto__ = Array.prototype; |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.