Skip to content

Instantly share code, notes, and snippets.

View wingyplus's full-sized avatar
😶‍🌫️
Burned out

Thanabodee Charoenpiriyakij wingyplus

😶‍🌫️
Burned out
View GitHub Profile
@wingyplus
wingyplus / ci.exs
Last active January 31, 2024 12:28
Mix.install([
{:dagger, "~> 0.9.4"}
])
defmodule Ci do
alias Dagger.{Client, Container, Directory, Host}
@workdir "/app"
# TODO: change to your release name.
@release "hello_world_dagger"
@wingyplus
wingyplus / headver.exs
Last active April 18, 2022 04:08
headver Elixir implementation
# headver.exs - a headver implementation in Elixir. See https://github.com/line/headver.
#
# Run
# $ elixir headver.exs --head=5 --build=23 --suffix=qa
# 5.2142.23+qa
Mix.install([
{:timex, "~> 3.7"}
])
@wingyplus
wingyplus / Program.fs
Last active November 4, 2020 07:22
Benchmark fibonacci on F#
// Learn more about F# at http://fsharp.org
open BenchmarkDotNet.Attributes
open BenchmarkDotNet.Running
let rec fibonacci n =
match n with
| 1 -> 1
| 2 -> 2
| n -> fibonacci (n - 1) + fibonacci (n - 2)
[None, Some(1), Some(2), None, Some(10)]
->Js.Array2.filter(a => Belt.Option.isSome(a))
->Js.Array2.map(n => Belt.Option.getExn(n))
->Js.log
Tue Aug 18 13:38:54 2020:["lsp#register_server", "server registered", "typescript support using typescript-language-server"]
Tue Aug 18 13:38:54 2020:["lsp#register_server", "server registered", "elixir-ls"]
Tue Aug 18 13:38:54 2020:["lsp#register_server", "server already registered", "typescript support using typescript-language-server"]
Tue Aug 18 13:38:54 2020:["lsp#register_server", "server registered", "typescript support using typescript-language-server"]
Tue Aug 18 13:38:54 2020:["lsp#register_server", "server already registered", "elixir-ls"]
Tue Aug 18 13:38:54 2020:["lsp#register_server", "server registered", "elixir-ls"]
Tue Aug 18 13:38:54 2020:["vim-lsp signs enabled"]
Tue Aug 18 13:38:54 2020:["vim-lsp virtual text enabled"]
Tue Aug 18 13:38:54 2020:["vim-lsp highlighting enabled"]
@wingyplus
wingyplus / Tests.cs
Created July 26, 2020 15:27
Learn C# from Unity. Use NUnit for test framework.
using System;
using NUnit.Framework;
namespace Syntax.Tests
{
public struct Vector2 : IFormattable
{
public float x, y;
public static Vector2 operator -(Vector2 a, Vector2 b)
@wingyplus
wingyplus / init.vim
Created May 11, 2020 04:16
A sample configuration for LSP
call plug#begin()
"
""" LSP
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
"
""" Language tools
@wingyplus
wingyplus / liff.js
Created March 19, 2020 12:49
LIFF wrapper with automatical replace when running under Cypress
/* eslint-disable no-undef */
// replaced liff when running in cypress sandbox
if (window.cy) {
console.log('liff: running in cypress sandbox')
window.liff = window.cy.liff
}
export default {
init() {
return new Promise((resolve, reject) =>
@wingyplus
wingyplus / file_server_v1.ex
Last active January 12, 2020 15:23
Practicing Elixir by using exercise from Programming Erlang 2nd edition
defmodule FileServer do
@doc """
starting FileServer process.
"""
def start(dir \\ ".") do
spawn(FileServer, :loop, [dir])
end
def loop(dir) do
receive do
$ ./configure --enable-rust-debug
checking for xcrun... xcrun
checking for make... yes
checking for GNU Make... make
checking build system type... x86_64-apple-darwin19.2.0
checking host system type... x86_64-apple-darwin19.2.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...