Skip to content

Instantly share code, notes, and snippets.

View mainerror's full-sized avatar

Octavian A. Damiean mainerror

  • University of Graz
  • Austria, Graz
View GitHub Profile
@Zirak
Zirak / usage.md
Last active December 12, 2015 01:28
XTRACT ZE FILES!

xzf, XTRACT ZE FILES!, is a utility for file extraction, as you may have guessed. Inspired by xkcd and general boredom. Works on both python v2.7 and v3.3.

Usage:

$ python xzf.py file [extra_tar_flags]

Or, programatically:

@Raynos
Raynos / x.md
Last active January 28, 2023 05:12
A list of minimal DOM libraries

DOM Libraries, the easy way

  • [by. Select elements][1]
  • [fragment. Turn HTML into DOMFragments][2]
  • [class-list. Cross browser HTML5 classList implementation][3]
  • [dom-walk. Traverse the DOM in tree order][4]
  • [xhr. Minimal cross browser, cross domain XHR][5]
  • [insert. Cross browser DOM4 insertion methods][6]
  • [to-array. Convert nodelists into arrays][7]
  • [hidden. Cross browser HTML5 hidden property][8]
#!/bin/bash
#a small script to automate installing from downloaded AUR tarballs
if [ ! -f $1 ]
then
echo "File $1 does not exist" 1>&2
exit
fi
base=$(basename -s '.tar.gz' $1) #meh
@Zirak
Zirak / gist:3086939
Last active August 27, 2022 22:01
xhr for dummies

So, you want to send a motherfucking XMLHttpRequest (XHR, or commonly and falsly known as AJAX.) Too bad, just ran out of motherfucking XMLHttpRequests; but I still have one regular. XHR is not magic. It does not autofuckinmagically send things the way you want them do be sent. It does not do the thinking for you. It just sends an Http Request.

You get a hold on such a prime beast like this:

@Zirak
Zirak / gist:1490195
Created December 17, 2011 13:21
Basic DOM element manipulation
//creating an element is easy peasy
var divElem = document.createElement( 'div' );
//divElem is now a div element. it's not related to the any other element or
// node, it's free-range.
//to add it to the body element, for example:
document.body.appendChild( divElem );
//splendidsimo!