Skip to content

Instantly share code, notes, and snippets.

View yukulele's full-sized avatar

Clément P yukulele

  • France
View GitHub Profile
@Hafthor
Hafthor / floatradix.js
Created April 10, 2021 23:45
non-decimal non-integer stuff
// like parseFloat, but takes an optional radix
function parseFloatWithRadix(s, r) {
r = (r||10)|0;
const [b,a] = ((s||'0') + '.').split('.');
const l1 = parseInt('1'+(a||''), r).toString(r).length;
return parseInt(b, r) +
parseInt(a||'0', r) / parseInt('1' + Array(l1).join('0'), r);
}
// like Number..toFixed, but takes an optional radix
@Zeinok
Zeinok / wine-breeze-dark-theme.md
Last active November 5, 2024 02:15
Breeze Dark theme for Wine

Made possible with this reddit post.

Install

wine regedit wine-breeze-dark.reg

Uninstall (Reset Wine color scheme)

wine regedit wine-reset-theme.reg

@ruanbekker
ruanbekker / tree_style_tab_firefox.md
Created November 28, 2019 06:18
Hide Native Tabs with Tree Style Tabs for Firefox
@jakub-g
jakub-g / async-defer-module.md
Last active November 4, 2024 20:19
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)

@1wheel
1wheel / geometry.js
Last active November 8, 2022 13:46
line-intersection
//creates new point
function P(x, y, color){
var rv
if (x.map){
rv = {x: x[0], y: x[1], color: 'black'}
} else{
rv = {x: x, y: y, color: color || 'black'}
}
rv.toString = function(){ return rv.x + ',' + rv.y }
rv.type = 'point'
@asciidisco
asciidisco / gist:5c0020f25d7d9dccc5c5
Created March 11, 2016 10:11
npm sass, autoprefixer, minifier, sourcemaps
"scripts" {
"styles:dev": "node-sass --source-map-embed --follow --output-style expanded src/styles/main.scss | postcss -u autoprefixer -u cssnano -o public/main.css --map file"
}
@wenchy
wenchy / Makefile
Last active January 16, 2024 15:36
Compile all .cpp files into one target under the current directory.
CC := g++
CFLAGS := -Wall -g
TARGET := test
# $(wildcard *.cpp /xxx/xxx/*.cpp): get all .cpp files from the current directory and dir "/xxx/xxx/"
SRCS := $(wildcard *.cpp)
# $(patsubst %.cpp,%.o,$(SRCS)): substitute all ".cpp" file name strings to ".o" file name strings
OBJS := $(patsubst %.cpp,%.o,$(SRCS))
all: $(TARGET)
@vgarvardt
vgarvardt / css.css
Created December 21, 2015 09:36
Pure CSS Star Wars opening crawl @ http://codepen.io/yukulele/pen/KsCIi
#target{
position:absolute;
top:-3500px;
bottom:0;
left:0;
right:0;
overflow:hidden;
font-size:30px;
text-align:center;
font-family:sans-serif;
@0XDE57
0XDE57 / config.md
Last active October 20, 2024 13:07
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@jhned
jhned / mza-snippet
Last active December 28, 2018 14:32
margin: 0 auto; gist for Emmet
{
"snippets": {
"css": {
"snippets": {
"mza": "margin: 0 auto;"
}
}
}
}