Skip to content

Instantly share code, notes, and snippets.

@fuddl
fuddl / ✔.svg
Created April 8, 2014 13:34
svg sample file
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fuddl
fuddl / 🌐.svg
Created September 19, 2014 07:21
a simple globe icon
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fuddl
fuddl / creative_commons.html
Created October 3, 2014 08:26
creeative commons icons using inline css only
<span title="Creative Commons" style="border: 3px solid black; border-radius: 50%; line-height: 1.5em; width: 1.5em; display: inline-block; text-align: center; font-family: sans-serif; font-weight: bold">cc</span>
<span title="No Derivative Works" style="border: 3px solid black; border-radius: 50%; line-height: 1.5em; width: 1.5em; display: inline-block; text-align: center; font-family: sans-serif; font-weight: bold">=</span>
<span title="Non commercial" style="border: 3px solid black; border-radius: 50%; line-height: 1.5em; width: 1.5em; display: inline-block; text-align: center; font-family: sans-serif; font-weight: bold; position: relative">$&#823;<span style="display: block; height: 100%; width:.2em; background-color: black; position: absolute; top: 0; left: 50%; margin-left:-.1em; transform: rotate(45deg)"></span></span><
<span title="Creative Commons" style="border: 3px solid black; border-radius: 50%; line-height: 1.5em; width: 1.5em; display: inline-block; text-align: center; font-family: sans-serif;
@fuddl
fuddl / youtube-embedd-responsive
Created December 8, 2014 17:03
Youtube iframe responsive
// embedd your youtube iframe using youtube as element class: <iframe class="youtube"…
$(function() {
var windowE = $(window);
windowE.bind('resize', function() {
$('iframe.youtube').each(function() {
var iframe = $(this);
var width = iframe.width();
var height = width * .61;
iframe.height(height);
@fuddl
fuddl / _php_mixins.jade
Last active August 29, 2015 14:11
jade php mixins
mixin php-foreach(expr)
| <?php foreach(!{expr}): ?>
block
| <?php endforeach; ?>
mixin php-print(expr)
| <?php print !{expr}; ?>
mixin php-if(expr)
| <?php if(!{expr}): ?>
# German translation of Drupal including common anglicisms.
msgid ""
msgstr ""
"Project-Id-Version: Drupal core (7.34)\n"
"POT-Creation-Date: 2014-01-25 08:37+0000\n"
"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
@fuddl
fuddl / lipsim.jade
Created March 11, 2015 13:09
deterministic lipsum mixin in jade. Does not create any 'random' text
- var loremCount = 0;
mixin lipsum(amount)
- var loremText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
- var lipsumArray = loremText.split(' ');
- var loremIpsum = '';
- var wordCount = lipsumArray.length
- for (var i = 0; i < amount; i++) {
- if(i > 0) {
- loremIpsum += ' ';
- }
@fuddl
fuddl / normal-rand.js
Last active October 13, 2015 08:47
Gaussian normal distribution
/**
* Generate a random number considering gaussian normal distribution.
*
* @param min
* The minimal value. Can be negative or positive.
*
* @param max
* The maximal value. Should be higher then min.
*
* @param dis
@fuddl
fuddl / hex.css
Created December 3, 2012 21:31
Displays html tables as hex matrix
table {
display: block;
}
tr {
display:block;
margin-bottom: -20px;
border-collapse: collapse;
}
@fuddl
fuddl / uncheckall.js
Last active December 17, 2015 15:39
Uncheck all checkboxes with jQuery
jQuery(':radio').removeAttr('checked');