Skip to content

Instantly share code, notes, and snippets.

View umhan35's full-sized avatar

Zhao Han umhan35

View GitHub Profile
@umhan35
umhan35 / .latexmkrc
Created March 16, 2016 01:51
use skim with latexmk
$pdf_previewer = "open -a Skim"
@umhan35
umhan35 / server.scala
Last active March 26, 2016 03:41
Simplest scala http server
import com.sun.net.httpserver._
import java.net._
val server = HttpServer.create(new InetSocketAddress(8000), 0)
server.createContext("/", new HttpHandler {
def handle(exchange: HttpExchange) {
exchange.sendResponseHeaders(200, 0)
exchange.getResponseBody.write("hello".getBytes)
exchange.getResponseBody.close()
@umhan35
umhan35 / print classpath from sbt.md
Last active April 10, 2016 16:25
print classpath from sbt

add the following to build.sbt

TaskKey[String]("cp") <<= (externalDependencyClasspath in Runtime) map (_.files.absString)

run show cp in sbt

@umhan35
umhan35 / Debug scala code using jdb.md
Last active April 10, 2016 16:25
Debug scala code using jdb
@umhan35
umhan35 / 0.m
Last active July 14, 2016 03:10
access asyncLocalStorage in objective-c
// add libReact.a
// import
#import "RCTAsyncLocalStorage.h"
// code
RCTAsyncLocalStorage *asyncLocalStorage = [[RCTAsyncLocalStorage alloc] init];
dispatch_async([asyncLocalStorage methodQueue], ^{
[asyncLocalStorage multiGetKeys:@[@"widget_city"] callback:^(NSArray *response){
#include <stdio.h>
int main() {
printf("%s\n", (char[]) {0b01101001, 0b00100000, 0b01101100, 0b01101111, 0b01110110, 0b01100101, 0b00100000, 0b01111001, 0b01101111, 0b01110101, '\0'});
}
cmake_minimum_required(VERSION 2.8.3)
project(a2)
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@umhan35
umhan35 / ros.md
Created March 27, 2019 19:48
ros

export ROSCONSOLE_FORMAT='[${severity}] [${time}] [${function}]: ${message}'

change to debug

cp /opt/ros/melodic/share/ros/config/rosconsole.config ~/rosconsole.config

export ROSCONSOLE_CONFIG_FILE=~/rosconsole.config

@umhan35
umhan35 / ros clion setup on Ubuntu.md
Last active April 4, 2019 16:19
ros clion setup

install clion via snap

snap will auto update the app

snap install clion

in config/options/project.default.xml