Skip to content

Instantly share code, notes, and snippets.

View mathiasschopmans's full-sized avatar

Mathias Schopmans mathiasschopmans

View GitHub Profile
/*
* RGBa-Mixin with fallback (http://css-tricks.com/rgba-browser-support/)
*/
=transparent-backgound($color: #000, $value:0.5)
$start: "rgb("
$end: ")"
background: #{$start}red($color), green($color), blue($color)#{$end}
background: rgba($color, $value)
javascript:var%20s=document.createElement('script');s.setAttribute('src',%20'http://jquery.com/src/jquery-latest.js');document.getElementsByTagName('body')[0].appendChild(s);alert('thank%20you%20for%20using%20jquery!');void(s);
@mathiasschopmans
mathiasschopmans / Wordpress: Get Latest Tweet by Username
Created October 1, 2010 17:14
A little Script that gets the latest Tweets and chaches it via Transient-API
/**
* Get the latest Tweet Text by Username
*
* @uses Transient - API for chaching
* @copyright Mathias Schopmans - 10/2010
*
* @param string $username: Twitter Username
*/
function get_last_tweet($username='nasenmann'){
<?
/*
Plugin Name: Meta-Boxes
Plugin URI:
Description: Bilder, Fotos, Beiträge, etc.
Version: 2.0
Author: Rheinschafe - Mathias Schopmans
/* ----------------------------------------------*/
$new_meta_boxes =
@mathiasschopmans
mathiasschopmans / inline-sprites.sass
Created August 5, 2014 10:02
Try to use compass' inline-image() with generated sprites.
$default-sprite-dimensions: true
$default-sprite-base-class: ".is"
@import "images/sprites/default/*.png"
@include all-default-sprites($prefix:"is")
.is
background-image: inline-image($default-sprites)
+inline-block
+hide-text
@mathiasschopmans
mathiasschopmans / _formhelper.jade
Last active September 9, 2015 08:01
Jade form-helpers. Can be used with bootstrap
mixin input(label, options)
- var defaults = {"tag":"input", "type":"text", "labelClass":"form-label", "name":sanitize(label), "placeholder":null, "value":null, "id":sanitize(label).substring(0, 10) + "-" + randomString(), "tabindex":null}
- var input = extend({}, defaults, {"label":label, "required":attributes.required}, options, attributes)
- var baseClass = input.type == "hidden" ? null : "form-control"
- delete attributes.required
if input.placeholder === true
- input.placeholder = label
if input.type == "hidden"
@mathiasschopmans
mathiasschopmans / neopixelring.ino
Created March 4, 2015 18:46
neopixel ring demo
#include <Adafruit_NeoPixel.h>
#include <avr/power.h>
#define PIN 0
Adafruit_NeoPixel strip = Adafruit_NeoPixel(24, PIN);
// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.
@mathiasschopmans
mathiasschopmans / capybara.rb
Created May 4, 2015 13:07
Ignore Capybara SSL verification (https errors) and add Capybara Screenshot functionality
Capybara.register_driver :webkit_ignore_ssl do |app|
Capybara::Webkit::Driver.new(app).tap {|d| d.browser.ignore_ssl_errors }
end
Capybara::Screenshot.register_driver(:webkit_ignore_ssl) do |driver, path|
driver.save_screenshot(path)
end
Capybara.javascript_driver = :webkit_ignore_ssl
Capybara.default_driver = :webkit_ignore_ssl
@mathiasschopmans
mathiasschopmans / hue-api.md
Last active February 8, 2020 18:44
HUE Remote-API summary + buildlamp script
@mathiasschopmans
mathiasschopmans / ObjectSize.php
Created December 4, 2016 13:52
Sort various (clothing) sizes in an array
<?php
class ObjectSize {
protected static $sizes = [
'xxxxl',
'xxxl',
'xxl',
'xl',
'l',