Skip to content

Instantly share code, notes, and snippets.

View Exifers's full-sized avatar

Emmanuel Meric de Bellefon Exifers

View GitHub Profile
@bozdag
bozdag / taking screenshot in linux with C
Last active February 7, 2021 14:14
This C program takes the whole screenshot of the root window for a given display and saves it in PNG file format.
/*
Grabs a screenshot of the root window.
Usage : ./scr_tool <display> <output file>
Example : ./scr_tool :0 /path/to/output.png
Author: S Bozdag <selcuk.bozdag@gmail.com>
*/
@paulirish
paulirish / what-forces-layout.md
Last active July 22, 2024 06:32
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@anvaka
anvaka / 00.Intro.md
Last active July 18, 2024 03:09
npm rank

npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
@tizmagik
tizmagik / getLastInMap.js
Created August 13, 2016 03:22
ES6 Last Item in Map()
// Since ES6 Map()'s' retain their order of insertion, it can sometimes be useful to get the last item or value inserted:
export const getLastItemInMap = map => Array.from(map)[map.size-1]
export const getLastKeyInMap = map => Array.from(map)[map.size-1][0]
export const getLastValueInMap = map => Array.from(map)[map.size-1][1]
// Obviously getLastKey and getLastValue can reuse getLastItem, but for maximum portability I opted for verbosity.
@bmaupin
bmaupin / free-database-hosting.md
Last active July 22, 2024 16:24
Free database hosting
@michaelroper
michaelroper / tailwind-palettte-app.json
Last active January 19, 2024 23:19
Tailwind CSS default colors in Palettte.app's JSON format
[
{
"paletteName": "gray",
"swatches": [
{
"name": "100",
"color": "#f7fafc"
},
{
"name": "200",
export const h=(t,p,...c)=>({t,p,c,k:p&&p.key})
export const render=(e,d,t=d.t||(d.t={}),p,r,c,m,y)=>
// arrays
e.map?e.map((e,p)=>render(e,d,t.o&&t.o[p])):
// components
e.t.call?(e.i=render((render.c=e).t(Object.assign({children:e.c},e.p),e.s=t.s||{},t=>
render(Object.assign(e.s,t)&&e,d,e)),t.i||d,t&&t.i||{}),d.t=t=e):(
// create notes
m=t.d||(e.t?document.createElement(e.t):new Text(e.p)),
// diff props