Skip to content

Instantly share code, notes, and snippets.

View thibaultcha's full-sized avatar
🕉️

Thibault Charbonnier thibaultcha

🕉️
View GitHub Profile
@jimmychu0807
jimmychu0807 / string-conversion.rs
Created November 21, 2019 10:20
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@oliveratgithub
oliveratgithub / emojis.json
Last active March 25, 2024 16:37
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "&#128104;&zwj;&#128105;&z
@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@marick
marick / about_those_lava_lamps.md
Last active June 22, 2022 21:08
About Those Lava Lamps

Around 2006-2007, it was a bit of a fashion to hook lava lamps up to the build server. Normally, the green lava lamp would be on, but if the build failed, it would turn off and the red lava lamp would turn on.

By coincidence, I've actually met, about that time, (probably) the first person to hook up a lava lamp to a build server. It was Alberto Savoia, who'd founded a testing tools company (that did some very interesting things around generative testing that have basically never been noticed). Alberto had noticed that people did not react with any urgency when the build broke. They'd check in broken code and go off to something else, only reacting to the breakage they'd caused when some other programmer pulled the change and had problems.

@kpettijohn
kpettijohn / gist:672a93e1df9e5f721604
Last active March 3, 2018 06:03
i3 notes for the Thinkpad X1 Carbon 3rd gen

Fn + F[1-12] keysym name

F1 XF86AudioMute
F2 XF86AudioLowerVolume
F3 XF86AudioRaiseVolume
F4 XF86AudioMicMute
F5 XF86MonBrightnessDown
F6 XF86MonBrightnessUp
F7 XF86Display
F8 XF86WLAN
@haasn
haasn / about:config.md
Last active April 2, 2024 18:46
Firefox bullshit removal via about:config

Firefox bullshit removal

Updated: Just use qutebrowser (and disable javascript). The web is done for.

@nijikokun
nijikokun / atom.pack
Last active August 29, 2015 14:07
Installed atom packages
/Users/mashape/.atom/packages (68)
├── Stylus@0.3.1
├── Sublime-Style-Column-Selection@1.1.3
├── Watchmenesque-Dark@0.6.0
├── abw-syntax@0.1.0
├── api-blueprint-preview@0.2.2
├── ask-stack@0.1.0
├── atom-lint@0.20.0
├── atom-spotify@0.6.1 (disabled)
├── atomatigit@1.0.0
@kikito
kikito / assert_contains.lua
Created August 29, 2014 11:44
Lua Busted table contains assertion
local s = require("say")
local function contains(container, contained)
if container == contained then return true end
local t1,t2 = type(container), type(contained)
if t1 ~= t2 then return false end
if t1 == 'table' then
for k,v in pairs(contained) do
if not contains(container[k], v) then return false end
@mathisonian
mathisonian / index.md
Last active March 22, 2023 05:31
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5

inspiration

@staltz
staltz / introrx.md
Last active April 15, 2024 10:24
The introduction to Reactive Programming you've been missing