Skip to content

Instantly share code, notes, and snippets.

View kevinkassimo's full-sized avatar
🤕
Tried to be less stupid, but failed

Kevin (Kun) "Kassimo" Qian kevinkassimo

🤕
Tried to be less stupid, but failed
View GitHub Profile

Keybase proof

I hereby claim:

  • I am kevinkassimo on github.
  • I am kassimo (https://keybase.io/kassimo) on keybase.
  • I have a public key ASAg9wH3PCLp0R9XdoCYEQ1ZPCwFKnBlq2QN4Tb7kjvHfQo

To claim this, I am signing this object:

@kevinkassimo
kevinkassimo / gox.text
Last active August 9, 2017 16:10 — forked from achun/gox.text
go get golang.org/x
# in China, the following lines won't work due to SSL problems. Use Github source or proxy instead
go get -u golang.org/x/crypto/bcrypt
go get -u golang.org/x/crypto/blowfish
go get -u golang.org/x/crypto/bn256
go get -u golang.org/x/crypto/cast5
go get -u golang.org/x/crypto/curve25519
go get -u golang.org/x/crypto/hkdf
go get -u golang.org/x/crypto/md4
go get -u golang.org/x/crypto/nacl/box
@kevinkassimo
kevinkassimo / react-pkg-install.sh
Created August 20, 2017 08:47
Install packages for React development
#!/bin/bash
# PropTypes from react is deprecated
npm install --save prop-types
# React suggest immutability-helper over legacy react-addons-update: https://facebook.github.io/react/docs/update.html
npm install --save immutability-helper
@kevinkassimo
kevinkassimo / Unity-SpatialHash2D.cs
Last active December 11, 2022 19:24
An at least runnable Unity3D Spatial Hash implementation
using UnityEngine;
using System.Collections;
using System.Linq;
using System.Collections.Generic;
// Adapted from https://unionassets.com/blog/spatial-hashing-295 AND
// Adapted from https://conkerjo.wordpress.com/2009/06/13/spatial-hashing-implementation-for-fast-2d-collisions/
namespace SpatialHash {
public interface ISpatialHashObject2D {
@kevinkassimo
kevinkassimo / qc.js
Created December 11, 2017 00:22
Fetch crypto price with Puppeteer (experimental script)
const puppeteer = require('puppeteer');
const fs = require('fs');
const currenciesJSON = fs.readFileSync('./config.json');
const currencies = JSON.parse(currenciesJSON).currencies;
puppeteer.launch({devtools: false}).then(async browser => {
for (let currency of currencies) {
const page = await browser.newPage();
if (currency == '') {
continue;
@kevinkassimo
kevinkassimo / xss-alert.js
Created December 20, 2017 18:52
Used for XSS attack challenge by https://xss-game.appspot.com/level6
alert("Hello world");
@kevinkassimo
kevinkassimo / sc-trick
Last active January 2, 2018 18:57
Get rid of warning
#!/bin/bash
# part of the script is introduced with inspiration from https://gist.github.com/tylergets/e4ab5bea35ddcd6c3134503b44284165
echo "Temporarily starting SafeConnect process..."
sudo launchctl enable system/scManagerD 2>&1 > /dev/null
sudo launchctl load /Library/LaunchDaemons/Safe.Connect.plist 2>&1 > /dev/null
sudo launchctl enable system/scClient 2>&1 > /dev/null
sudo launchctl load /Library/LaunchAgents/Safe.Connect.client.plist 2>&1 > /dev/null
cd /Applications/SafeConnect.app/Contents/MacOS/
@kevinkassimo
kevinkassimo / p5_twitter_test.sh
Last active March 5, 2018 00:54
Testing twitter.edges results for Project 5
#!/bin/bash
rm -rf ./output
echo "====== Testing part B results..."
echo "====== Running scala-shell..."
spark-shell -i topUsers.scala
echo "====== Validating results..."
@kevinkassimo
kevinkassimo / rd
Last active April 9, 2018 20:39
RD (regular directory), Fancier cd
#!/bin/bash
### Change current directory and cache it
# e.g.
# $ rd some/dir
# (after a while)
# $ rd # jump to some/dir
function rd {
if [[ ! -z "$1" ]]; then
cd "$1"
const createDecorator = () => {
const {
Provider: RawProvider,
Consumer: RawConsumer,
} = React.createContext(null);
const provider = (value) => (WrappedClass) => {
return class extends React.Component {
constructor(props) {
super(props);