Skip to content

Instantly share code, notes, and snippets.

View olambdao's full-sized avatar

Sukeui Liam Lim olambdao

View GitHub Profile
@olambdao
olambdao / erc721.sol
Created December 10, 2019 00:00
ERC721 flatten code
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.5.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
@olambdao
olambdao / main.go
Created November 15, 2019 10:23
Test slice of pointer vs slice
package main
import "fmt"
type Foo struct {
Foo, Bar int
}
func PrintSlice(v []Foo) {
fmt.Printf("[]Foo: [0] %p, [1] %p\n", &v[0], &v[1])
@olambdao
olambdao / make banana.js
Last active May 2, 2018 06:17
JS에서 바나나 만들기
"B" + ["a", "a"].join("aaa" - 1)
"BaNaNa"
private Vector3 DoBezierFor4Points(float t, Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3)
{
Vector3 returnVector = Vector3.zero;
float oneMinusT = (1f - t);
returnVector += p0 * oneMinusT * oneMinusT * oneMinusT;
returnVector += p1 * t * 3f * oneMinusT * oneMinusT;
returnVector += p2 * 3f * t * t * oneMinusT;
returnVector += p3 * t * t * t;
@olambdao
olambdao / metadata.tsv
Last active December 15, 2016 06:56
word2vec model - movie clustering
title genre year
Drop Dead Gorgeous (1999) Comedy 1990
X-Men: Days of Future Past (2014) Action 2010
Waking Ned Devine (a.k.a. Waking Ned) (1998) Comedy 1990
Birdcage, The (1996) Comedy 1990
Inside Out (2015) Adventure 2010
Contender, The (2000) Drama 2000
Mortal Kombat (1995) Action 1990
Wallace & Gromit in The Curse of the Were-Rabbit (2005) Adventure 2000
Panic Room (2002) Thriller 2000
@olambdao
olambdao / guess_type.py
Last active September 5, 2016 08:13
guess type from string
from datetime import datetime
tests = [
# (Type, Test)
(int, int),
(float, float),
(datetime, lambda value: datetime.strptime(value, "%Y/%m/%d"))
]
def getType(value):