private typedef Props = {
var classes:TClasses;
}
private typedef TClasses = Classes<[
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cs.system.collections.generic.IEnumerator_1; | |
import cs.system.collections.generic.KeyValuePair_2; | |
import cs.system.collections.generic.Dictionary_2; | |
using Main; | |
@:nativeGen class Main { | |
public static function main() { | |
var dict = new Dictionary_2<String, String>(); | |
dict.Add('hello', 'world'); |
Because I have no trust in people.
<hashlink>
points to your installation of Hashlink, e.g. folder in whichhl.exe
(or Unix executable) is, alongside with library binaries (.hdll
files), andinclude
folder.<src>
points to the folder containing generated HL/C sources. One that containshlc.json
file.<app>
refers to your output executable name, including extension.<main>
refers to your entry-point file name, including extension (see below).- I provide example of doing it on Windows via MSVC
cl.exe
, but Unix should be more or less same with replacement of argument flags and compiler. - I expect that you DO have a compiler installed and can call
cl.exe
or other compiler from command-line.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test { | |
static function main() { | |
var req = makeRequest(Foo, r -> trace(r.foo)); | |
req.send(); | |
var req2 = makeRequest(Bar(42), r -> trace(r.answer)); | |
req2.send(); | |
} | |
static function makeRequest<T>(endpoint:Endpoint<T>, handler:T->Void) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"user_id": 123456, | |
"contrib_id": 123456, | |
"cookie": "..." | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MONITORS=$(xrandr | grep -o '[0-9]*x[0-9]*[+-][0-9]*[+-][0-9]*') | |
# Get the location of the mouse | |
XMOUSE=$(xdotool getmouselocation | awk -F "[: ]" '{print $2}') | |
YMOUSE=$(xdotool getmouselocation | awk -F "[: ]" '{print $4}') | |
for mon in ${MONITORS}; do | |
# Parse the geometry of the monitor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mode: Focus | |
# --------------------------- | |
set $mode_focus Focus: (Shift+1~5) Mark ⋅ (1~5) Focus ⋅ (Alt+1~5) Clear ⋅ (a) Create custom ⋅ (g) Focus custom ⋅ (c) Clear custom | |
mode "$mode_focus" { | |
# Keybindings for custom marks | |
bindsym a exec i3-input -F 'mark %s' -P 'Mark name: ' | |
bindsym g exec i3-input -F '[con_mark=%s] focus' -P 'Go to mark: ' | |
bindsym c exec i3-input -F 'unmark %s' -P 'Clear mark: ' | |
# Assign marks to keys 1-5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mode: Screenshot | |
# --------------------------- | |
set $monitorGeom $(monitor-geom) | |
set $maimCopy | xclip -selection clipboard -t image/png | |
set $maimFilename ~/Pictures/Screenshots/$(date +%Y-%m-%d-%H:%M-%S-%N).png | |
set $mode_screenshot Screenshot mode: (w) Window ⋅ (x) All screens ⋅ (s) Selection ⋅ (d) Desktop ⋅ (w/x/s/d + Shift) Use clipboard | (c) Color picker | |
mode "$mode_screenshot" { | |
# Save screenshot to file | |
bindsym w exec --no-startup-id maim -i $(xdotool getactivewindow) $maimFilename, mode "default" | |
bindsym x exec --no-startup-id maim $maimFilename, mode "default" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lua << EOF | |
require'compe'.setup { | |
enabled = true; | |
autocomplete = true; | |
debug = false; | |
min_length = 1; | |
preselect = 'enable'; | |
throttle_time = 80; | |
source_timeout = 200; | |
incomplete_delay = 400; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lua << EOF | |
local nvim_lsp = require('lspconfig') | |
nvim_lsp.pyright.setup{} | |
-- Use an on_attach function to only map the following keys | |
-- after the language server attaches to the current buffer | |
local on_attach = function(client, bufnr) | |
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end | |
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end |