For example, you want to set 40% alpha transparence to #000000
(black color), you need to add 66
like this #66000000
.
import React, { | |
AppRegistry, Component, StyleSheet, | |
Text, View, TouchableOpacity, TextInput | |
} from 'react-native' | |
import { createStore, combineReducers, bindActionCreators } from 'redux' | |
import { connect, Provider } from 'react-redux' | |
import { reducer as form, reduxForm } from 'redux-form' | |
const Button = ({ children, onPress }) => <TouchableOpacity onPress={onPress}> | |
<Text>{children}</Text> |
docker exec -i CONTAINER_ID /bin/bash -c "export TERM=xterm && mysql -proot -uroot database" < import.sql |
import * as mongoose from 'mongoose'; | |
export let Schema = mongoose.Schema; | |
export let ObjectId = mongoose.Schema.Types.ObjectId; | |
export let Mixed = mongoose.Schema.Types.Mixed; | |
export interface IHeroModel extends mongoose.Document { | |
name: string; | |
power: string; |
#!/bin/bash | |
TARGET="mysite.example.net"; | |
RECIPIENT="[email protected]"; | |
DAYS=7; | |
echo "checking if $TARGET expires in less than $DAYS days"; | |
expirationdate=$(date -d "$(: | openssl s_client -connect $TARGET:443 -servername $TARGET 2>/dev/null \ | |
| openssl x509 -text \ | |
| grep 'Not After' \ | |
|awk '{print $4,$5,$7}')" '+%s'); | |
in7days=$(($(date +%s) + (86400*$DAYS))); |
Simple implementation of debounced fetching in GraphQL to allow merging of multiple rest / database requests into one. Although this example uses GraphQL, the debouncedFetch
/ fetchProgramPlaycount
implementations could probably be used in any context to achieve the same result.
This approach was first described by @leebyron at graphql/graphql-js#19 (comment)
For example this allows turning ten requests for playcounts from this GraphQL query into just one:
{
latestPrograms(first: 10) {
name,
playcount
[ | |
{ | |
"city": "New York", | |
"growth_from_2000_to_2013": "4.8%", | |
"latitude": 40.7127837, | |
"longitude": -74.0059413, | |
"population": "8405837", | |
"rank": "1", | |
"state": "New York" | |
}, |
-
Include Weather Icons in your app: https://github.com/erikflowers/weather-icons
-
Include the below JSON in your application, for example purposes, lets assume it's a global named
weatherIcons
. -
Make a request to OpenWeatherMap:
req = $.getJSON('http://api.openweathermap.org/data/2.5/weather?q=London,uk&callback=?');
This document is research for the selection of a communication platform for robot-net.
The purpose of this component is to enable rapid, reliable, and elegant communication between the various nodes of the network, including controllers, sensors, and actuators (robot drivers). It will act as the core of robot-net to create a standardized infrastructure for robot control.
Requirements:
function test() { | |
var results = []; | |
results.push(compareSemver("1.8.3", "1.8.3", "==")); | |
results.push(compareSemver("1.9.1", "1.11.1", "<")); | |
results.push(compareSemver("1.5.3", "1.9", "<")); | |
results.push(compareSemver("1.3.2", "1.10.2", "<=")); | |
results.push(compareSemver("1.3.2", "1.3.2", "<=")); | |
results.push(compareSemver("1.11.1", "1.9.1", ">")); | |
results.push(compareSemver("1.11.1", "1.11.0", ">")); | |
results.push(compareSemver("1.10.2", "1.5.2", ">=")); |