Skip to content

Instantly share code, notes, and snippets.

View areski's full-sized avatar
🤗
Working at DialerAI

Areski Belaid areski

🤗
Working at DialerAI
  • Star2Billing // DialerAI
  • Barcelona
  • X @areskib
View GitHub Profile
use std::collections::HashMap;
use std::fmt;
use std::io;
use std::num::ParseFloatError;
use std::rc::Rc;
/*
Types
*/
@josevalim
josevalim / watcher.sh
Last active February 28, 2024 07:42
A 1LOC bash script for re-running tests whenever a lib/ or test/ file changes keeping the same VM instance
# You will need fswatch installed (available in homebrew and friends)
# The command below will run tests and wait until fswatch writes something.
# The --stale flag will only run stale entries, it requires Elixir v1.3.
fswatch lib/ test/ | mix test --stale --listen-on-stdin
@zackify
zackify / gist:acf19f6ca0f8be13fb90
Last active January 14, 2020 15:06
Visually see react elements
setInterval(function() {
Array.prototype.slice.call(document.querySelectorAll('[data-reactid]'))
.forEach(function(element) {
element.style.background = 'rgba(255,0,0,0.1)';
})
}, 500)
@wolever
wolever / histogram.sql
Last active April 19, 2023 20:28
Functions to create and draw histograms with PostgreSQL.
-- Functions to create and draw histograms with PostgreSQL.
--
-- psql# WITH email_lengths AS (
-- -# SELECT length(email) AS length
-- -# FROM auth_user
-- -# LIMIT 100
-- -# )
-- -# SELECT * FROM show_histogram((SELECT histogram(length, 0, 32, 6) FROM email_lengths))
-- bucket | range | count | bar | cumbar | cumsum | cumpct
-- --------+-------------------------------------+-------+--------------------------------+--------------------------------+--------+------------------------
@ericbmerritt
ericbmerritt / *.app.src
Last active December 22, 2015 01:29
ErlangCamp Amsterdam 2013
{application, <App Name>,
[{description, "<App Description>"},
{vsn, "<App Version>"},
{modules, [<Module List>]},
{registered, [<Registered Modules]},
{applications, [<Dependency List>]},
{mod, {<Application Behaviour Module>, []}}]}.
@jrus
jrus / lua-uuid.lua
Created July 29, 2012 09:26
quick lua implementation of "random" UUID
local random = math.random
local function uuid()
local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
return string.gsub(template, '[xy]', function (c)
local v = (c == 'x') and random(0, 0xf) or random(8, 0xb)
return string.format('%x', v)
end)
end
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.