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
echo -e "\n Downloading formatcss...\n" | |
platform=`uname -s` | |
distro=`cat /etc/*-release 2>/dev/null | grep ^ID=[A-Za-z]* | sed s/ID=/-/g | sed s/\"//g` | |
arch=`uname -m` | |
curl -sL -o /usr/bin/formatcss github.com/calbertts/formatcss/releases/latest/download/formatcss-$platform$distro-$arch | |
chmod a+x /usr/bin/formatcss | |
echo -e "\n Great!, now you can run 'formatcss' from anywhere\n\n Try with:\n \e[92mformatcss --url https://www.w3schools.com/w3css/4/w3.css\n\n\e[0m" |
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
OBJDIR=.obj | |
CC=gcc | |
CFLAGS=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d -Wno-array-bounds | |
LDFLAGS=-flto | |
CFLAGS_OPT=$(CFLAGS) -O2 -flto | |
DEFINES:=-D_GNU_SOURCE | |
CFLAGS+=$(DEFINES) | |
LIBS=/usr/local/lib/quickjs/libquickjs.a | |
INCLUDES=-I/usr/local/include/quickjs |
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 * as std from "std" | |
import * as os from "os" | |
import { open, close } from "process" | |
const CHUNK_SIZE = 200000 // 200KB | |
const fd = open('curl 2>/dev/null https://jsonplaceholder.typicode.com/users', 'r') | |
os.setReadHandler(fd, function() { | |
let readBuf = new Uint8Array(CHUNK_SIZE) |
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
#include <quickjs/quickjs.h> | |
#include <errno.h> | |
#include <string.h> | |
#define countof(x) (sizeof(x) / sizeof((x)[0])) | |
JSValue createError(JSContext *ctx, int err) { | |
JSValue obj; | |
obj = JS_NewError(ctx); |
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
MIT License | |
Copyright (c) 2017 Martin Buberl | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
# vim:fileencoding=utf-8:ft=conf | |
# You can include secondary config files via the "include" directive. | |
# If you use a relative path for include, it is resolved with respect to the | |
# location of the current config file. For example: | |
# include other.conf | |
# Fonts {{{ | |
# Font family. You can also specify different fonts for the | |
# bold/italic/bold-italic variants. By default they are derived automatically, |
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
" Kepp selected test when fixing indentation | |
vnoremap < <gv | |
vnoremap > >gv | |
"Clipboard | |
set clipboard=unnamedplus | |
" Netwr (Explore) | |
let g:netrw_banner = 0 | |
let g:netrw_liststyle = 3 |
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
let g:loaded_youcompleteme = 1 | |
if empty(glob('~/.vim/autoload/plug.vim')) | |
silent execute "!curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" | |
autocmd VimEnter * PlugInstall | source $MYVIMRC | |
endif | |
" Kepp selected test when fixing indentation | |
vnoremap < <gv | |
vnoremap > >gv |
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
function color_my_prompt { | |
local __user_and_host="@\u" | |
local __cur_location="\[\033[01;34m\]\W" | |
local __git_branch_color="\[\033[32m\]" | |
local __git_branch='`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\\(.+\)$/\\\\\\1\\ /`' | |
local __prompt_tail="\[\033[35m\]$" | |
local __last_color="\[\033[00m\]" | |
export PS1="$__user_and_host $__cur_location $__git_branch_color$__git_branch$__prompt_tail$__last_color " | |
} | |
color_my_prompt |
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
removec() { | |
export FZF_DEFAULT_OPTS='--height 90% --reverse --border' | |
local container=$((docker ps -a --filter status=exited --format '{{.Names}} => {{.Image}} => EXITED' & docker ps -a --filter status=created --format '{{.Names}} => {{.Image}} => CREATED') | fzf-tmux --reverse --multi | awk -F '\\=>' '{print $1}') | |
if [[ $container != '' ]]; then | |
echo -e "\n \033[1mDocker container:\033[0m" $container | |
printf " \033[1mAre you sure?: \033[0m" | |
local cmd=$(echo -e "No\nYes" | fzf-tmux --reverse --multi) | |
if [[ $cmd != '' ]]; then | |
if [[ $cmd == 'Yes' ]]; then | |
echo -e " Removing $container ...\n" |
NewerOlder