Skip to content

Instantly share code, notes, and snippets.

View tcostam's full-sized avatar
Need more coffee

Tiago Costa tcostam

Need more coffee
View GitHub Profile
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active March 27, 2024 06:09
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

function http-ping {
SLEEP=${2:-5}
while true; do echo "$(date +'%Y-%m-%d %H:%M:%S') - GET $1 - $(curl -sL -w "%{http_code}" -o /dev/null $1)"; sleep $SLEEP; done
}
@datchley
datchley / react-redux-style-guide.md
Last active February 13, 2024 14:30
React + Redux Style Guide
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@henriquemenezes
henriquemenezes / vim.md
Last active February 18, 2020 04:22
Vim

Vimtutor:

Tips & Tricks

	:source $MYVIMRC	Reload .vimrc without restart vim, after reload run :e
	:e 			Reload buffer and trigger FileType event

Modes:

@henriquemenezes
henriquemenezes / array-diff.js
Created March 17, 2016 20:08
JS array diff
function arrayDiff(a1, a2) {
var diff = {};
for (var i = 0; i < a1.length; i++) {
diff[a1[i]] = true;
}
for (var i = 0; i < a2.length; i++) {
if (diff[a2[i]]) {
delete diff[a2[i]];
@henriquemenezes
henriquemenezes / one-line-web-server.md
Created March 16, 2016 20:48
List of one-line web servers

One-line Web Servers

Python 2.x

python -m SimpleHTTPServer 8080

Python 3.x

@henriquemenezes
henriquemenezes / pre-commit
Created March 8, 2016 20:33
Git's pre-commit hook to remove trailing whitespaces/tabs Raw
#!/bin/sh
#
# This will remove the trailing whitespaces from the files and add it again to be committed.
#
# Put this into ~/.git-templates/hooks/pre-commit, and chmod +x it.
# Detect platform
platform="win"
uname_result=`uname`
if [ "$uname_result" = "Linux" ]; then
@henriquemenezes
henriquemenezes / .vimrc
Last active August 11, 2020 14:47
.vimrc
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim " set the runtime path to include Vundle
call vundle#begin() " and initialize
" Keep Plugin commands between vundle#begin/end.
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'