Skip to content

Instantly share code, notes, and snippets.

@jalakoo
jalakoo / chessdataset.cypher
Created January 11, 2022 23:57
discoveraurafree - week 3 - load data
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/zq99/pgn2data/master/samples/caruana_carlsen_2018_moves.csv" AS row
MERGE (p:Position {fen:row.fen})
CREATE (m:Move {move:row.move, colour:row.color, no:tointeger(row.move_no_pair), piece:row.piece})
CREATE (m)-[:RESULTS_IN]->(p);
@jalakoo
jalakoo / nbadataset.cypher
Last active January 11, 2022 23:49
discoveraurafree - week 1 - load data
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/fivethirtyeight/data/master/nba-elo/nbaallelo.csv" AS row
//skipping doubles, also Aura Free limit of 50k nodes, ~ 100 teams
WITH row LIMIT 99900 WHERE row._iscopy="0"
MERGE (ht:Team {code:row.team_id})
ON CREATE SET ht.name = row.fran_id
MERGE (at:Team {code:row.opp_id})
ON CREATE SET at.name = row.opp_fran
CREATE (m:Match {id:row.game_id, venue:right(row.game_id, 3), date:row.date_game})
WITH ht, at, m, row.pts AS hpoints, row.opp_pts AS apoints,
row.elo_i AS hse, row.elo_n AS hee, row.opp_elo_i AS ase,
@jalakoo
jalakoo / boardgamegeek.cypher
Created January 11, 2022 23:47
discoveraurafree - week 2 - load data
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/ThaWeatherman/scrapers/b8757711296703356891f8f4e7757de6698a6b5b/boardgamegeek/games.csv" AS ROW
WITH ROW WHERE tointeger(row.playingtime) > 9
AND tointeger(row.playingtime) <61
CREATE (g:Game {name:row.name, weight:tofloat(row.average_weight),
rating:tofloat(row.average_rating),
playingTime:tointeger(row.playingtime), id:row.id})
MERGE (pmin:PlayerCount {value:tointeger(row.minplayers)})
MERGE (pmax:PlayerCount {value:tointeger(row.maxplayers)})
WITH g, pmin, pmax
CREATE (g)-[:HAS_MIN_PLAYERS]->(pmin)
@jalakoo
jalakoo / style.css
Created October 21, 2020 20:35
Sendbird Getting Started UIKit JS - Final
.App {
font-family: sans-serif;
text-align: center;
height: 100vh;
}
@jalakoo
jalakoo / App.js
Created October 21, 2020 20:34
Sendbird Getting Started UIKit JS - Final
import React from "react";
import { App as SendbirdApp } from "sendbird-uikit";
import "sendbird-uikit/dist/index.css";
import "./styles.css";
const APP_ID = "45612F31-4304-4FC4-9FD9-C35B5FCDCE30"
const USER_ID = "Demo User"
export default function App() {
@jalakoo
jalakoo / App.js
Created October 21, 2020 20:33
Sendbird Getting Started UIKit JS - Intermediate 2
import React from "react";
import { App as SendbirdApp } from "sendbird-uikit";
import "sendbird-uikit/dist/index.css";
import "./styles.css";
const APP_ID = "45612F31-4304-4FC4-9FD9-C35B5FCDCE30";
const USER_ID = "Demo User";
@jalakoo
jalakoo / App.js
Created October 21, 2020 20:32
Sendbird Getting Started UIKit JS - Intermediate
import React from "react";
import { App as SendbirdApp } from "sendbird-uikit";
import "sendbird-uikit/dist/index.css";
import "./styles.css";
export default function App() {
return (
<div className="App">
<h1>Hello CodeSandbox</h1>
@jalakoo
jalakoo / style.css
Created October 21, 2020 20:31
Sendbird Getting Started UIKit JS - Start
.App {
font-family: sans-serif;
text-align: center;
}
@jalakoo
jalakoo / App.js
Last active October 21, 2020 20:30
Sendbird Getting Started UIKit JS - Start
import React from "react";
import "./styles.css";
export default function App() {
return (
<div className="App">
<h1>Hello CodeSandbox</h1>
<h2>Start editing to see some magic happen!</h2>
</div>
);
@jalakoo
jalakoo / index.js
Created October 21, 2020 20:30
Sendbird Getting Started UIKit JS - Start
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
const rootElement = document.getElementById("root");
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,