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
html = new Proxy({ | |
div: document.createElement('div'), | |
dom(string) { | |
this.div.innerHTML = string | |
return this.div.firstChild | |
}, |
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
html | |
head | |
link(href="https://fonts.googleapis.com/css?family=Roboto+Mono:100,100i,300,300i,400,400i,500,500i,700,700i" rel="stylesheet") | |
style | |
:sass | |
body | |
width: 100vw | |
height: 100vh | |
margin: 0 |
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
integrate = (f, { min = 0, max = 1, n = 1000 } = {}) => { | |
let s = 0 | |
for (let i = 0; i < n; i++) { | |
let x = min + (max - min) * (i + 1/2) / n | |
s += f(x) | |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class SceneHelper : MonoBehaviour | |
{ | |
private void OnDrawGizmos() | |
{ | |
Gizmos.color = Color.yellow; | |
Gizmos.matrix = transform.localToWorldMatrix; |
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
let style = document.createElement('style'); | |
style.innerHTML = $` | |
body, body > * { | |
box-sizing: border-box; | |
position: relative; | |
margin: 0; | |
display:flex; | |
flex-direction |
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 React from 'react'; | |
import { StyleSheet, Text, View, TextInput, KeyboardAvoidingView } from 'react-native'; | |
import Button from './src/view/Button' | |
import Movies from './src/view/Movies' | |
const API_KEY = '870c92db52a5e74ad6c1b6b06b19cfb9' | |
const API_MOVIE_ENDPOINT = 'https://api.themoviedb.org/3/search/movie' | |
const getSearchUrl = (query:string, page:number = 1) => { |
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 React from 'react'; | |
import { StyleSheet, Text, View, TextInput, KeyboardAvoidingView } from 'react-native'; | |
import Button from './src/view/Button' | |
import Movies from './src/view/Movies' | |
const API_KEY = '870c92db52a5e74ad6c1b6b06b19cfb9' | |
const API_MOVIE_ENDPOINT = 'https://api.themoviedb.org/3/search/movie' | |
const getSearchUrl = (query, page = 1) => { |
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> | |
<html> | |
<head> | |
<meta charset='utf-8'> | |
<meta http-equiv='X-UA-Compatible' content='IE=edge'> | |
<title>ar demo</title> | |
<script src='https://aframe.io/releases/0.9.2/aframe.min.js'></script> | |
<script src="https://raw.githack.com/jeromeetienne/AR.js/master/aframe/build/aframe-ar.min.js"></script> | |
<script src="https://raw.githack.com/donmccurdy/aframe-extras/master/dist/aframe-extras.loaders.min.js"></script> | |
<script> |
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
// https://gist.github.com/jniac/35ec5237a0b06359ae37ba5802e12bef | |
const isNullOrUndefined = item => item === null || item === undefined | |
const isObject = item => !!(item && typeof item === 'object') | |
const clone = object => { | |
if (!isObject(object)) | |
return object |
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
function* walk(object, currentPath = []) { | |
for (let [key, value] of Object.entries(object)) { | |
const path = [...currentPath, key] | |
yield [key, value, path] | |
if (value && typeof(value) === 'object') | |
yield* walk(value, path) |
OlderNewer