Skip to content

Instantly share code, notes, and snippets.

@nanchu
nanchu / layoutdemo.css
Last active December 14, 2015 02:58
2 column layout with same height regardless of content, header + sticky footer
/*css reset*/
html,body {position:relative;margin:0;padding:0;min-height:100%;width:100%;height:100%;}
div,p,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td, figure {margin:0;padding:0;}
ol,ul {list-style:none;}
li {list-style-type: none;}
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
html, body {
font-family: Helvetica;
height: 100%; /*important for equal height columns*/
@kosinix
kosinix / custom-nav-walker-usage.php
Last active April 25, 2023 09:32
WordPress: Using a custom nav walker to create navigation menus in plain <a> tags. That is the <ul> and <li> tags are not present. Very useful if you want to create simple links that can be centered with a simple text-align:center on the containing element.
<?php
// In your template files like footer.php
// The items_wrap value ('%3$s') removes the wrapping <ul>, while the custom walker (Nav_Footer_Walker) removes the <li>'s.
wp_nav_menu(array('items_wrap'=> '%3$s', 'walker' => new Nav_Footer_Walker(), 'container'=>false, 'menu_class' => '', 'theme_location'=>'footer', 'fallback_cb'=>false ));
?>
@pklaus
pklaus / bottle-server.py
Last active January 12, 2019 15:59 — forked from anjackson/gist:2888380
Mounting a proxy server to a /path of a Bottle app
import bottle
from hacks import ProxyServer
root = bottle.Bottle()
ps = ProxyServer()
root.mount(ps.wrapped_proxy_app, "/proxyapp")
@root.route('/hello/:name')
@schwuk
schwuk / plexmediaserver
Created August 29, 2013 10:24
UFW Application Profile for Plex Media Server
[plexmediaserver]
title=Plex Media Server
description=The Plex Media Server is smart software that makes playing Movies, TV Shows and other media on your computer simple
ports=32400/tcp|1900/udp|32469/udp|5353/udp
@Lopo
Lopo / PKGBUILD
Last active January 3, 2016 08:29
Source of gitlab package for Arch Linux
moved to https://github.com/Lopo/archlinux-packages
@jmcarp
jmcarp / forceDownload.js
Created March 1, 2014 15:35
Forcing a file download in JavaScript
function forceDownload(href) {
var anchor = document.createElement('a');
anchor.href = href;
anchor.download = href;
document.body.appendChild(anchor);
anchor.click();
}
@mikkeloscar
mikkeloscar / guide.md
Created June 14, 2014 20:44
Setup armv7h chroot under x86_64 host (Archlinux/Archlinuxarm biased)

Setup armv7h chroot under x86_64 host (Archlinux/Archlinuxarm biased)

Simple way to setup an arm chroot for building packages for your arm devices. This is an alternative to cross-compiling where you are limited to only linking against the libs in your toolchain.

Setup chroot-fs

You can store the chroot wherever you like. I choose to store it in a disk-image which I mount to my filesystem.

@kost
kost / i2c-dump.py
Created August 4, 2014 23:37
Script to dump I2C using pyBusPirateLite
#!/usr/bin/env python
# encoding: utf-8
"""
Adapted from i2c-test.py from Peter Huewe
"""
import sys
from pyBusPirateLite.I2C import *
import argparse
@cahna
cahna / ansible-aur-pkg-installer.md
Last active September 11, 2022 06:26
download, build, and install aur packages with ansible

About

When using ArchLinux, I typically prefer to use an AUR helper like pacaur or yaourt to automate away the process of installing a community package.

Ansible's pacman module is great, but it doesn't support AUR packages or pacman's -U flag. Installing AUR packages with Ansible seemed to be left as an exercise to the user, and since AUR helpers do not come with a fresh Arch install, I

@chipx86
chipx86 / streaming-tar.py
Last active October 20, 2022 21:17
Sample code to build a tar chunk-by-chunk and stream it out all at once.
#!/usr/bin/env python
#
# Building a tar file chunk-by-chunk.
#
# This is a quick bit of sample code for streaming data to a tar file,
# building it piece-by-piece. The tarfile is built on-the-fly and streamed
# back out. This is useful for web applications that need to dynamically
# build a tar file without swamping the server.
import os
import sys