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 Dexie from "dexie"; | |
import { addMinutes } from "date-fns"; | |
import { firestore } from "firebase"; | |
const DB_NAME: string = "id_cache"; | |
const DB_VER: number = 1; | |
class IdCache { | |
db: Dexie; |
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
class Sphera { | |
constructor({ | |
x = 0, | |
y = 0, | |
radius = 10, | |
color = Sphera.colors[parseInt(Math.random() * Sphera.colors.length)], | |
speed = 1, | |
angle = 0, | |
text = '', | |
border = 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
import java.util.*; | |
public class dijk { | |
public static void main(String[] args) { | |
Graph g = new Graph(9); | |
g.addEdge(0, 1, 4); | |
g.addEdge(0, 7, 8); | |
g.addEdge(1, 2, 8); | |
g.addEdge(1, 7, 11); |
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, { Component } from 'React'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
Dimensions, | |
TextInput, | |
TouchableOpacity, | |
ScrollView, | |
Keyboard |
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, Button, Dimensions, Animated, Easing, TouchableOpacity } from 'react-native'; | |
const SideMenu = () => ( | |
<View> | |
<Text>Open up App.js to start working on your app!</Text> | |
<Text>Changes you make will automatically reload.</Text> | |
<Text>Shake your phone to open the developer menu.</Text> | |
</View> | |
); |
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
Broken Necklace | |
You have a necklace of N red, white, or blue beads (3<=N<=350) some of which are red, others blue, and others white, arranged at random. Here are two examples for n=29: | |
1 2 1 2 | |
r b b r b r r b | |
r b b b | |
r r b r | |
r r w r | |
b r w w |
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
class Calendar { | |
constructor(container) { | |
this.container = container; | |
this.today = new Date(); | |
this.render(); | |
} | |
renderHeader() { | |
let today = this.today; | |
let container = this.container; |
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 loadData = (cb) => { | |
const req = new XMLHttpRequest(); | |
const url = "https://yoon2-hastedk.c9users.io/team/manu"; | |
req.onreadystatechange = () => { | |
console.log("received", req.readyState, req.status); | |
if(req.readyState == 4 && req.status == 200) { | |
cb(JSON.parse(req.responseText)); | |
} | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
/* | |
Simple web server that proxies a remote image | |
run: simple-server . $PORT | |
*/ | |
var http = require('http'); | |
var url = require('url'); | |
var request = require('request'); |
NewerOlder