Skip to content

Instantly share code, notes, and snippets.

View clouds56's full-sized avatar

Clouds clouds56

  • Switzerland
View GitHub Profile
@clouds56
clouds56 / config.nu
Last active April 29, 2025 03:18
nushell/starship
$env.config.show_banner = false
$env.config.table.mode = 'light'
$env.PROMPT_COMMAND = { ||
let last_exit = if ($env.LAST_EXIT_CODE != 0) {
$"(ansi red)($env.LAST_EXIT_CODE | into string)(ansi reset) "
} else { "" }
let user = (ansi blue) + (whoami | str trim) + (ansi reset)
let host = (hostname | str trim)
let dir = (ansi white_bold) + ($env.PWD | str replace $nu.home-path "~") + (ansi reset)
@clouds56
clouds56 / 01_javacall.jl
Created November 25, 2018 11:02
Spark macro for julia binding
using JavaCall
convertible(::Type{JavaObject{T}}, ::Type{JavaObject{S}}) where {T, S} = JavaCall.isConvertible(T, S)
convertible(javatype::Type, juliatype::Type) = hasmethod(convert, Tuple{Type{javatype}, juliatype})
function jtypeforclass(cls::JClass)
isarray(cls) = jcall(cls, "isArray", jboolean, ()) != 0x00
if isarray(cls)
jcomponentcls = jcall(cls, "getComponentType", JClass, ())
return Array{jtypeforclass(jcomponentcls), 1}
@clouds56
clouds56 / _game_2048.re
Last active December 20, 2017 12:16
2048 in reasonml
type direction =
| Up
| Down
| Left
| Right;
type action =
| NewGame
| Move(direction)
| Add(int, int, option(int))
@clouds56
clouds56 / TiebaCrawler.md
Last active June 18, 2017 07:03
tieba_crawler

TiebaCrawler

crawler.py

change thread_id in the code and run via scrapy runspider -L INFO crawler.py

result.ipynb

  1. change the filebase and "dump" cell (see # write your own query here)
  2. run all cells