Skip to content

Instantly share code, notes, and snippets.

View kasparsd's full-sized avatar

Kaspars Dambis kasparsd

View GitHub Profile

How to Version a Stylesheet in WordPress

wp_enqueue_style() is your friend

In your theme, you should be using the wp_enqueue_style() function instead of calling your stylesheet directly in your header.php file. Use something like this in your theme's functions.php file:

<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_stylesheet' );
@benhosmer
benhosmer / timed_capture.py
Last active December 17, 2015 18:29
Raspberry pi camera module time-delayed loop.
#!/usr/bin/env python
'''
Usage:
python timed_capture.py
'''
import datetime
from time import sleep
import subprocess
fps = 1 # The number of frames to capture per second.
@emachnic
emachnic / fstab
Created August 26, 2013 13:01
Automatically mount Apple Extreme hard drive in Raspberry PI running XBian using fstab.
#/etc/fstab
//10.0.1.1/My\040Passport\040for\040Mac /media/Passport cifs rw,username=xbian,pass=********,sec=ntlm 0 0
@westonruter
westonruter / .gitmodules
Last active November 26, 2018 21:17
Test widget plugin for WordPress issue #27491: Widget Customizer: Dynamically-created inputs cause from to replace itself without event to trigger re-initialization https://core.trac.wordpress.org/ticket/27491
[submodule "chosen"]
path = chosen
url = git@github.com:harvesthq/chosen.git
@lukecav
lukecav / Links
Last active October 7, 2019 09:39
DevKit CLI Beta
@h4
h4 / LYWSD02.txt
Created May 20, 2019 06:48
LYWSD02 sensor available characteristics
Service: 00001800-0000-1000-8000-00805f9b34fb
Characteristic: 00002a00-0000-1000-8000-00805f9b34fb
READ
b'LYWSD02'
Characteristic: 00002a01-0000-1000-8000-00805f9b34fb
READ
b'\x00\x00'
Service: 00001801-0000-1000-8000-00805f9b34fb
Characteristic: 00002a05-0000-1000-8000-00805f9b34fb
READ INDICATE
@festlv
festlv / main.py
Last active January 7, 2022 22:27
air-guard main.py exploratory prototype
from sargs import *
# Pārbaude pēc ieslēgšanās: ieslēdzam visas gaismas diodes pēc kārtas
pins = [LED_ZALS, LED_DZELTENS, LED_SARKANS, LED_KREISA_ACS, LED_LABA_ACS]
for p in pins:
p.ieslegt()
pagaidit(0.5)
# Nedaudz uzgaidot, izslēdzam visas gaismas diodes apgrieztā kārtībā
pagaidit(1)
@ziogaschr
ziogaschr / debian-wvdial-ppp0-interface-autossh.markdown
Last active July 31, 2023 13:50
Reverse proxy over 3G modem (draft)

Reverse proxy over 3G modem (draft)

We will explain how to configure a cubieboard running debian as a reverese proxy. The modules that will be used are wvdial and autossh

Credits goes to:

1. http://blog.rootshell.be/2015/02/19/my-little-pwnie-box/
2. https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd
@hissy
hissy / nav-menu-exporter-importer.php
Last active August 13, 2023 17:06
[WordPress Plugin] Nav Menu Exporter and Importer / Export and Import nav menus. Requires WordPress Importer plugin.
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/