Skip to content

Instantly share code, notes, and snippets.

View msikma's full-sized avatar
🚀
オープンソースの熱狂的なファン

Michiel Sikma msikma

🚀
オープンソースの熱狂的なファン
View GitHub Profile
@msikma
msikma / set-states.scss
Last active August 29, 2015 14:08
Set container pseudo-selector states
@mixin set-states($states) {
$selector: ();
@for $i from 1 through length($states) {
$selector: append($selector, unquote("&:#{nth($states, $i)}"), comma);
}
#{$selector} {
@content;
}
}
@msikma
msikma / select-php-var.php
Created November 3, 2014 13:20
Select PHP variable
<?php
// select php variable (more or less)
$sel_php_var = '\$([^\s,.;=*+\-&~%-+|)]*)';
@msikma
msikma / gmail-colors.txt
Created November 3, 2014 13:23
Old Gmail label color swatches
light blue green #DEF9F2
light blue 2 #E0ECFF
light blue 3 #DFE2FF
lavender #E0D5F9
light pink #FDE9F4
light pink 2 #FFE3E3
gray blue #5A6986
bright blue #206CFF
blue #0000CC
purple #5229A3
@msikma
msikma / img-load-cb.js
Created November 3, 2014 13:27
jQuery Image load callback (IE6 compatible)
// requires jQuery 1.x
// image load callback that is compatible with IE6
var $img = $('.some-selector img');
var isIE6 = jQuery.browser.msie && parseInt(jQuery.browser.version) == 6;
$img.one("load", function()
{
/*
image load event code goes here
@msikma
msikma / list_all_countries_eu.js
Last active July 10, 2021 10:24
List of all countries – separated, inside European Union and outside EU
/**
* List of countries, with country code (ISO 3166-1), separated by whether
* they're inside or outside the EU. This list has been updated as of
* 2014-12-04, per the list of deleted countries
* at <http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2>.
*/
var listAllCountries = {
'insideEU': {
'AT': 'Austria',
@msikma
msikma / aural-only.scss
Created January 12, 2015 22:07
CSS class to hide text for everything except screen readers
// Class to hide something except on aural browsers/screen readers.
// Just setting display: none does not work, since then it hides the item
// on aural browsers too.
// This set of attributes appear to have good results, but feedback
// from users of screen readers is always appreciated.
.aural-only {
height: 1px;
margin: -1px;
clip: rect(0px, 0px, 0px, 0px);
border: none;
@msikma
msikma / all_countries.json
Created January 13, 2015 09:56
List of all countries – as per ISO 3166-1, up-to-date as of 2015-01-13
{
"AT": "Austria",
"BE": "Belgium",
"BG": "Bulgaria",
"HR": "Croatia",
"CY": "Cyprus",
"CZ": "Czech Republic",
"DK": "Denmark",
"EE": "Estonia",
"FI": "Finland",
@msikma
msikma / jscs-without-es6-jsx.js
Created January 14, 2015 23:27
jscs configuration that excludes es6/jsx
// JSCS - for testing code style.
jscs: {
options: {
config: 'jscs.json',
},
gruntfile: {
src: ['gruntfile.js']
},
// es6 and jsx are not testable yet.
src: {
@msikma
msikma / SassMeister-input.scss
Created February 7, 2015 19:36
Generated by SassMeister.com.
// ----
// libsass (v3.1.0-beta)
// ----
@mixin pulsate($animation-name, $start-size: 0.75, $end-size: 1, $duration: 1.5s) {
@keyframes #{$animation-name} {
0% { transform: scale($start-size); }
50% { transform: scale($end-size); }
100% { transform: scale($start-size); }
}
@msikma
msikma / rfc5646-language-tags.js
Created February 26, 2015 13:51
RFC 5646 Language Tags
// List of language tags according to RFC 5646.
// See <http://tools.ietf.org/html/rfc5646> for info on how to parse
// these language tags. Some duplicates have been removed.
var RFC5646_LANGUAGE_TAGS = {
'af': 'Afrikaans',
'af-ZA': 'Afrikaans (South Africa)',
'ar': 'Arabic',
'ar-AE': 'Arabic (U.A.E.)',
'ar-BH': 'Arabic (Bahrain)',
'ar-DZ': 'Arabic (Algeria)',