Skip to content

Instantly share code, notes, and snippets.

View hs0ucy's full-sized avatar
💭
"Hyperlinks subvert (hack) hierarchy"

Hugo Soucy hs0ucy

💭
"Hyperlinks subvert (hack) hierarchy"
View GitHub Profile
@ap
ap / html2markdown.xslt
Last active August 26, 2020 08:35
HTML to Markdown in (E)XSLT
<xsl:stylesheet version="1.0"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://exslt.org/functions"
xmlns:str="http://exslt.org/strings"
xmlns:my="urn:my:"
extension-element-prefixes="fn str my"
>
<xsl:output method="text" encoding="utf-8" />
@ryansully
ryansully / optimize.sh
Created February 1, 2012 23:56 — forked from realdeprez/optimize.sh
image optimization script (pngcrush & jpegtran)
#!/bin/sh
# script for optimizing images in a directory (recursive)
# pngcrush & jpegtran settings from:
# http://developer.yahoo.com/performance/rules.html#opt_images
# pngcrush
for png in `find $1 -iname "*.png"`; do
echo "crushing $png ..."
pngcrush -rem alla -reduce -brute "$png" temp.png
@wdkrnls
wdkrnls / org-syntax-cheatsheet.org
Created March 7, 2012 03:54
Org-mode Syntax Cheat sheet

Markup Cheat sheet for Org-mode

Heading 1

Heading 2: Set a deadline and a schedule

[66%] Heading 3: a list with checkboxes

  1. [X] task 1
  2. [X] task 2
  3. [ ] task 3
anonymous
anonymous / button-arrow-gradient.css
Created December 12, 2012 13:30
CSS Button with arrow & gradient (Square rotation technique).
.button-next-arrow {
background-image: linear-gradient(bottom, rgb(52,70,115) 20%, rgb(103,125,180) 80%);
background-image: -o-linear-gradient(bottom, rgb(52,70,115) 20%, rgb(103,125,180) 80%);
background-image: -moz-linear-gradient(bottom, rgb(52,70,115) 20%, rgb(103,125,180) 80%);
background-image: -webkit-linear-gradient(bottom, rgb(52,70,115) 20%, rgb(103,125,180) 80%);
background-image: -ms-linear-gradient(bottom, rgb(52,70,115) 20%, rgb(103,125,180) 80%);
background-image: -webkit-gradient(
linear,
left bottom,
@pkuczynski
pkuczynski / LICENSE
Last active March 14, 2025 14:12
Read YAML file from Bash script
MIT License
Copyright (c) 2014 Piotr Kuczynski
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@wilfm
wilfm / grephexcolourcode
Created September 14, 2015 17:54
Grep Hex Colour Codes from file
#!/bin/bash
#get hex codes in form #fff and #ffffff
#checks to see if not - especially needed on #fff matches
#FIXME: - currently prints trailing character
if [[ ! -a $1 ]]; then
echo File not found
exit 1
fi
sed ':a;N;$!ba;s/\n/ /g' "$1" | grep -o '\#[0-9a-fA-F]\{3\}[^0-9a-fA-F]' | sed 's/[^0-9a-fA-F#]//g' | sort -u
@paulirish
paulirish / what-forces-layout.md
Last active March 15, 2025 16:10
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
@Eloi
Eloi / browser_automation.sh
Last active December 1, 2021 18:24
Simple shellscript to easily reload browser/terminal/other windows, without losing focus on the current window. Bind it to some useful key shortcut (p.e. win+r) to speed up web development process ;)
#!/bin/sh
if [ -n "$1" ]; then
if [ "$1" = "grab_id" ]; then
xdotool selectwindow >/tmp/autoreload_window_id
elif [ "$1" = "reload" ]; then
WINDOWID=`cat /tmp/autoreload_window_id`
/*
* An URI datatype. Based upon examples in RFC3986.
*
* TODO %-escaping
* TODO split apart authority
* TODO split apart query_string (on demand, anyway)
*
* @(#) $Id$
*/