Reloading public files on Amber.
You need Crystal and Amber::CMD installed
require "kemal" | |
get "/stream" do |env| | |
env.response.print "START" | |
env.response.flush | |
sleep 3 | |
env.response.print "MIDDLE" | |
env.response.flush | |
sleep 5 | |
env.response.print "END" |
Debugging an Amber project on VSCode with GDB and Native Debug.
<?xml version="1.0"?> | |
<m> <p x="0.550563524346" y="0.758024984088" z="-0.349682612032"/> | |
<p x="0.62319582135" y="0.436643142534" z="0.648821804759"/> | |
<p x="0.975676690271" y="-0.177816333299" z="-0.12820432003"/> | |
<p x="-0.32007250628" y="0.0780544757795" z="0.944172171553"/> | |
<p x="0.437594031513" y="-0.598061218782" z="0.671441912732"/> | |
<p x="0.32007250628" y="-0.0780544757795" z="-0.944172171553"/> | |
<p x="0.250253520018" y="-0.916161840828" z="-0.313082508502"/> | |
<p x="-0.437594031513" y="0.598061218782" z="-0.671441912732"/> | |
<p x="-0.62319582135" y="-0.436643142534" z="-0.648821804759"/> |
# Tic Tac Toe on Crystal based on C implementation https://gist.github.com/MatthewSteel/3158579 | |
def grid_char(i) | |
case i | |
when -1 | |
'X' | |
when 0 | |
' ' | |
when 1 | |
'O' |
# Huffman Tree generator for Ruby and Crystal | |
# @faustinoaq | |
# Jan, 2017 | |
class Element | |
def initialize(sym = '\0', fr = 1.0) | |
@ch = nil | |
if sym != '\0' | |
@ch = [Element.new] |
set number | |
set nowrap | |
set expandtab | |
set shiftwidth=2 | |
set tabstop=2 | |
set mouse=a | |
call plug#begin('~/.vim/plugged') | |
Plug 'kien/ctrlp.vim' |
body { | |
font-family: Arial, Helvetica, sans-serif; | |
max-width: 1280px; | |
margin: 0 auto; | |
padding: 0 5%; | |
} | |
a { | |
text-decoration: none; | |
} |
;; @faustinoaq | |
;; GNU Emacs 24 | |
;; ~/.emacs.d/init.el | |
;; MELPA packages | |
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.org/packages/") t) | |
(package-initialize) |
A = [] of Nil | |
{% A << 0 %} | |
{% A << "Some String" %} | |
{% p A[0] %} # => 0 | |
{% p A[1] %} # => "Some String" |