Skip to content

Instantly share code, notes, and snippets.

View suhanlee's full-sized avatar
:octocat:
Focusing

kyle suhanlee

:octocat:
Focusing
View GitHub Profile
@suhanlee
suhanlee / drb_client.rb
Created October 21, 2017 05:03
drb_example
require 'drb/drb'
require 'pp'
obj = DRbObject.new_with_uri('druby://localhost:1234')
pp obj
pp obj.to_a
pp obj.to_single
@suhanlee
suhanlee / gist:a03161d167e02290af12675d4ec31287
Created November 1, 2017 19:14 — forked from dustismo/gist:6203329
How to install leveldb on ubuntu
sudo apt-get install libsnappy-dev
wget https://leveldb.googlecode.com/files/leveldb-1.9.0.tar.gz
tar -xzf leveldb-1.9.0.tar.gz
cd leveldb-1.9.0
make
sudo mv libleveldb.* /usr/local/lib
cd include
sudo cp -R leveldb /usr/local/include
@suhanlee
suhanlee / recurse.exs
Created November 5, 2017 12:23
elixir recursive pattern
defmodule Recurse do
def loopy([head | tail]) do
IO.puts "Head: #{head} Tail: #{inspect(tail)}"
loopy(tail)
end
def loopy([]), do: IO.puts "Done!"
end
@suhanlee
suhanlee / str_reverse.py
Created November 10, 2017 00:31
String reverse
reduce(lambda x,y: y + x, "abcde")
@suhanlee
suhanlee / matplot1.py
Last active November 12, 2017 18:12
matplot
from matplotlib import pyplot as plt
years = [1950, 1960, 1970, 1980, 1990, 2000, 2010]
gdp = [300.2, 543.3, 1075.9, 2862.5, 5979.6, 10289.7, 14958.3]
plt.plot(years, gdp, color='green', marker='o', linestyle='solid')
plt.title("Nominal GDP")
plt.ylabel("Billions of $")
public class AppConfig extends WebMvcConfigurerAdapter{
@Bean
public MessageSource messageSource() {
ReloadableResourceBundleMessageSource bean = new ReloadableResourceBundleMessageSource();
bean.setBasename("classpath:messages");
bean.setDefaultEncoding("UTF-8");
return bean;
}
@Bean
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
@suhanlee
suhanlee / index.js
Created February 25, 2018 16:30
code-push
import App from './app/index';
import CodePush from 'react-native-code-push';
const app = CodePush({
installMode: CodePush.InstallMode.IMMEDIATE,
updateDialog: true
})(App);
@suhanlee
suhanlee / package.json
Last active March 15, 2018 18:30
react webpack configuration
{
"name": "react-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "1.1.1"
},
"scripts": {
@suhanlee
suhanlee / register.ex
Last active March 24, 2018 13:19
TodoServer
Process.register(self, :some_name)
send(:some_name, :msg)
receive do
msg -> IO.puts "received #{msg}"
end