Skip to content

Instantly share code, notes, and snippets.

View rollecode's full-sized avatar
🔥
on fire! 🔥🔥🔥

Rolle Laukkarinen rollecode

🔥
on fire! 🔥🔥🔥
View GitHub Profile
@bueltge
bueltge / set-featured-image.php
Created June 14, 2012 12:41
Set featureed image automaticly on save post/page
@krogsgard
krogsgard / woo-loop-image-wrap.php
Created June 29, 2012 03:51
WooCommerce insert wrapper around thumbnail images in loop
<?php
/* This snippet removes the action that inserts thumbnails to products in teh loop
* and re-adds the function customized with our wrapper in it.
* It applies to all archives with products.
*
* @original plugin: WooCommerce
* @author of snippet: Brian Krogsard
*/
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10);
@snowman-repos
snowman-repos / gist:3817354
Created October 2, 2012 08:33
PHP: Calendar Table
<?php
function build_calendar($month,$year,$dateArray) {
// Create array containing abbreviations of days of week.
$daysOfWeek = array('S','M','T','W','T','F','S');
// What is the first day of the month in question?
$firstDayOfMonth = mktime(0,0,0,$month,1,$year);
@championofblocks
championofblocks / wav-mp3
Last active December 6, 2025 21:51
Command line bash to convert all wav to mp3
for i in *.wav; do lame -b 320 -h "${i}" "${i%.wav}.mp3"; done
@mkotsalainen
mkotsalainen / image_compressor.sh
Created November 10, 2012 15:11
A shell script that wraps compresses all png/jpegs images under a directory
#!/bin/bash
if [[ $# -ne 1 || ! -d $1 ]]; then
echo "Usage: image_compressor.sh [dir]"
exit 1
fi
# check requirements
for cmd in optipng jpegoptim setfattr
@radu-gheorghe
radu-gheorghe / traffic.sh
Created November 16, 2012 14:24
bash script for checking out traffic via /proc/net/dev
#!/bin/bash
#shows traffic on the specified device
function human_readable {
VALUE=$1
BIGGIFIERS=( B K M G )
CURRENT_BIGGIFIER=0
while [ $VALUE -gt 10000 ] ;do
VALUE=$(($VALUE/1000))
@jareware
jareware / SCSS.md
Last active July 11, 2026 19:42
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@damoun
damoun / complete.sh
Last active July 21, 2022 23:57
Send notification when transmission finished to download a file.
#!/bin/bash
/var/lib/transmission-daemon/notify.py $TR_TORRENT_NAME
@benhagen
benhagen / libdnet_python.rb
Last active February 20, 2025 09:57
Install Scapy on OSX through Homebrew
require 'formula'
class LibdnetPython <Formula
depends_on 'libdnet'
url 'http://libdnet.googlecode.com/files/libdnet-1.12.tgz'
homepage 'http://code.google.com/p/libdnet/'
sha1 '71302be302e84fc19b559e811951b5d600d976f8'
def install
ENV["CFLAGS"] = "-O3 -w -pipe"
@prebenlm
prebenlm / .A how to display Irssi-hilights in OS X Notification Center.md
Last active July 12, 2026 15:06
Guide: how to make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier

Irssi in Mac OS X Notification Center

Mou icon

Overview

This guide will explain how you can make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier.

We will also explain how the process can be automatically started each time you log in to your Mac and ensure the connection to the server is kept alive.