This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> <!-- This tag specifies we use HTML5, the newest version of HTML --> | |
<html> <!-- Our opening html tag that everything else goes inside of it --> | |
<head><!-- Our opening head tag will contain meta data like page title scripts, styles and more.. --> | |
<meta charset="UTF-8"> | |
<!-- a meta tag that informs the browser we will use utf-8 to show all languages, like arabic, greek and hebrew --> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- a meta tag that informs the browser to keep the maximum width to fit the device (mainly used for mobile) --> | |
<title>My website title</title> | |
<!-- Our page title tag (content will show at the tab of the browser) --> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# only works atm if only one jdk package in downloads | |
DOWNLOADS=$HOME/Downloads | |
CURRENT_VERSION=$(java -version 2>&1) | |
JDK=` ls $DOWNLOADS | grep "jdk"` | |
STUDIO_URL=http://dl.google.com/android/studio/install/0.3.2/android-studio-bundle-132.893413-linux.tgz | |
if [ "uname -m" == "i386" -o "uname -m" == "i686" ]; then | |
ARCH=32 | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a new repository on the command line | |
touch README.md | |
git init | |
git add README.md | |
git commit -m "first commit" | |
git remote add origin https://github.com/c0ldlimit/vimcolors.git | |
git push -u origin master | |
# Push an existing repository from the command line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as tf from "@tensorflow/tfjs" | |
import "@tensorflow/tfjs-node" | |
import iris from "./iris.json" | |
import irisTesting from "./iris-testing.json" | |
// convert/setup our data | |
const trainingData = tf.tensor2d(iris.map(item => [ | |
item.sepal_length, item.sepal_width, item.petal_length, item.petal_width, | |
])) | |
const outputData = tf.tensor2d(iris.map(item => [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var zip = new JSZip(); | |
var count = 0; | |
var zipFilename = "zipFilename.zip"; | |
var urls = [ | |
'http://image-url-1', | |
'http://image-url-2', | |
'http://image-url-3' | |
]; | |
urls.forEach(function(url){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createState, subscribe, useSubscribe } from "jstates-react"; | |
const counterState = createState({ counter: 0 }); | |
const addOne = () => counterState.setState(state => ({ counter: ++state.counter })); | |
const removeOne = () => counterState.setState(state => ({ counter: --state.counter })) | |
function Counter() { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createState = require("jstates"); | |
const myState = createState({ counter: 0 }); | |
function onUpdate(state) { | |
console.log("onUpdate: counter =", state.counter); | |
} | |
myState.subscribe(onUpdate); | |
myState.setState(state => ({ counter: ++state.counter })); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Platform } from 'react-native'; | |
const isWeb = Platform.OS === 'web'; | |
const isNative = !isWeb; | |
const isIos = Platform.OS === 'ios'; | |
const isAndroid = Platform.OS === 'android'; | |
const isDesktop = isWeb && typeof matchMedia !== 'undefined' && matchMedia('(min-width: 768px)').matches; | |
const isMobile = !isDesktop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HelloReact = () => ( | |
<div> | |
<p>Hello React</p> | |
</div> | |
); | |
const HelloReactNative = () => ( | |
<View> | |
<Text>Hello ReactNative</Text> | |
</View> |
NewerOlder