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
# 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.
@pkuczynski
pkuczynski / parse_yaml.sh
Last active April 9, 2024 18:36
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
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,
@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
@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
@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" />