git clone git@github.com:deanmcpherson/react-native-tvos-example.git
cd react-native-tvos-example
npm install
npm start
Open ios/townskTV.xcodeproj in Xcode
import React from 'react' | |
import mrEmitter from '../helpers/mrEmitter' | |
export default class EmittingComponent extends React.Component { | |
handleClick = () => { | |
mrEmitter.emit('onSomeEvent', 'foo sends bar') | |
} | |
render() { |
defmodule Image do | |
defstruct [:grid, :pixel_map] | |
end | |
defmodule RandomImageGenerator do | |
def create(width, bar_size, filename \\ "out.png") do | |
%Image{} | |
|> create_grid(width) | |
|> build_pixel_map(width, bar_size) |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
.bar { | |
fill: steelblue; | |
} | |
.axis path { | |
/*display: none;*/ |
// hasClass, takes two params: element and classname | |
function hasClass(el, cls) { | |
return el.className && new RegExp("(\\s|^)" + cls + "(\\s|$)").test(el.className); | |
} | |
/* use like below */ | |
// Check if an element has class "foo" | |
if (hasClass(element, "foo")) { |
// package.json | |
"jest": { | |
"roots": [ | |
"<rootDir>/tests/unit" | |
], | |
"moduleNameMapper": { | |
"[\\s\\S]*.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/tests/unit/__mocks__/fileMock.js", | |
"[\\s\\S]*.(css|less)$": "<rootDir>/tests/unit/__mocks__/styleMock.js", | |
"~/([a-zA-Z0-9/.\\-_]*)": "<rootDir>/src/$1" |
defmodule Chat.Client do | |
# In all of the following functions 'server' stands for the server's pid | |
def join(server) do | |
send server, :join | |
end | |
def say(server, message) do | |
send server, { :say, message } | |
end |
# List all databases | |
sudo -u postgres psql --list | |
# Create backup file | |
sudo -u postgres pg_dump [database_name] > dumpl.sql | |
# Drop the database | |
sudo -u prostgres dropdb [database_name] | |
# Create a new database |
I hereby claim:
To claim this, I am signing this object:
const OAuth = require('oauth'); | |
const Twit = require('twit'); | |
const nconf = require('nconf'); | |
// temp global var | |
var oAuthTokenSecret; | |
// load config file which contains twitter app tokens | |
nconf.file({ file: './config/twitter-share.json' }).env() |