Skip to content

Instantly share code, notes, and snippets.

@lewtds
lewtds / index.html
Last active December 5, 2020 17:10
Materialize DB + Sanic + SSE Chat app
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCnbYwhjBbA4hx/ehHRoxF4lcIPGa0k9qhe3f6eyRuHRHuL+30bpbxD4nWmgwPaKnQ4E9AU0VOvNwNdkewKs/7CSm/HIXWjuRVa3eHf2TLXcD/jAaub0Qidahi9gHwAmVNyG/blwszN3uXIvXarxJivC2r/HIF2sGGs6w0mRMFqm2XMo/oLcM9p0ofIRJpzf4KZ+rxWX40Shcp+5pXgujG+vFubD0z+qTuspJAyhnKz9xJ3f6Nn/DtgVgmwnx/2UkTHm4c2bSQSAvqmoFHZBABOXYxme/kywfc29MdsCL/LQxRW8HGBHYvKTX/t3ut0/bcgOnMKTPIV5xx+yCtF6p5h trung.ngo@G0548.local

Keybase proof

I hereby claim:

  • I am lewtds on github.
  • I am lewtds (https://keybase.io/lewtds) on keybase.
  • I have a public key ASC_SlGr1V9Z2FQqsPjeWQb4bCEGiflEIJ5lOByzeJ0WOwo

To claim this, I am signing this object:

test: bogo.pl test.c
swipl-ld -goal true -o test test.c bogo.pl
clean:
rm -rf test
@lewtds
lewtds / polygon-with-a-hole.geojson
Last active May 17, 2019 10:42 — forked from andrewharvey/polygon-with-a-hole.geojson
A GeoJSON Polygon with a hole
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Xcode 10 introduces a new build system and breaks a few libraries that RN depends on. The known issues are tracked here: facebook/react-native#19573 and hopefully patches will be available in the next release.

Meanwhile, you can follow the manual workarounds here.

glog (config.h missing)

cd node_modules/react-native/third-party/glog-0.3.4 
./configure
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
03:00:41.990949;3
03:00:51.927086;3
03:00:51.943162;3
03:00:52.647186;4
03:00:52.663194;3
03:00:53.263249;3
03:00:53.279232;3
03:00:55.367203;3
03:00:55.383273;3
03:00:55.983285;3
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <signal.h>
#include <math.h>
#include <sys/time.h>
#define STATUS_GOING 0
#define STATUS_LOST 1
#define STATUS_WON 2
@lewtds
lewtds / path.py
Created September 27, 2017 17:49
def neighbors(row, col, rows, cols):
n = []
for i, j in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
if 0 <= col + i and col + i < cols and 0 <= row + j and row + j < rows:
n.append((row + j, col + i))
return n
def get_number_of_reachable_fields(grid, rows, columns, start_row, start_column):
// @flow
import React from 'react';
import { Updater, view as viewWrapper } from 'redux-elm';
import { takeEvery, takeLatest } from 'redux-saga';
import { call, put, fork, cancel, take, race } from 'redux-saga/effects';
import run from './boilerplate';
type State = {
count: number,