Skip to content

Instantly share code, notes, and snippets.

@leostratus
leostratus / webkit-pseudo-elements.md
Created September 21, 2012 01:44
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@boriskaiser
boriskaiser / gist:4078611
Created November 15, 2012 13:17
mixin for border-radius (without compass )
@mixin border-radius($radius...) {
// defining prefixes so we can use them in mixins below
$prefixes: ("-webkit", "-moz", "-ms", "-o", "");
@each $prefix in $prefixes {
#{$prefix}-border-radius: $radius;
}
border-radius: $radius;
}
@jlittlejohn
jlittlejohn / gist:4084291
Created November 16, 2012 05:04
SCSS: Translate3d (Mixin)
@mixin translate3d($x, $y, $z) {
-webkit-transform: translate3d($x, $y, $z);
-moz-transform: translate3d($x, $y, $z);
-o-transform: translate3d($x, $y, $z);
transform: translate3d($x, $y, $z);
}
@jonschlinkert
jonschlinkert / regular-expressions.md
Created November 16, 2012 20:14
My commonly used regular expressions

##Find/Replace tag attributes

###everything between <a >

<div/?[a\s]*[^>]*>

###everything between

href="/?[a\s]*[^>]*?" 
@larrybotha
larrybotha / _px-and-rem.scss
Last active April 9, 2018 16:50
Sass mixin - rems with px fallback
// This mixin outputs a property with rem units and a px fallback.
// Values passed without units are used as multipliers for the final
// rem and px values, all other units are output without modification.
// $base-font-size represents the root value of the document font-size
// in pixels.
//
// i.e. html { font-size: 100%;} // -> 16px
// Usage:
// @include px-and-rem([property], [multiplier | explicit value] [, ...]);
@joshhumble
joshhumble / dabblet.css
Created December 4, 2012 19:12
The Box-Ordinal-Group and Flexbox
/**
* The Box-Ordinal-Group and Flexbox
*/
.box {
overflow:hidden;
display:box;
display:-ms-box;
display:-moz-box;
display:-webkit-box;
@lenage
lenage / setup-git-server.md
Last active March 25, 2016 12:00
How to set up your own private Git server on Linux

1.安装Git

ssh myserver.com
sudo apt-get update
sudo apt-get install git-core

2.设置git用户

@tmcw
tmcw / mapcss_cartocss_cascadenik.md
Created December 17, 2012 16:33
MapCSS vs CartoCSS

In which I begrudglingly compare MapCSS and CartoCSS because people keep asking.

I hate this kind of writing - it's annoying to try to describe one bit of software versus another, and this can and will fall out of date every time that somebody makes a big change to their library. But people want it, or whatever, so here it is.

Since CartoCSS and Cascadenik are weird cousins, the big difference is between them and MapCSS.

Let's see, differences:

  • CartoCSS is designed for Mapnik. That is, it tries to expose every possible Mapnik style option and ability, and supports every Mapnik datasource.
  • MapCSS is designed for OSM. That is, it makes it easy to style based on OpenStreetMap data types, tags, and so on.
/* More pseudo classes */
input:disabled { ... }
input:invalid { ... }
/* Matches-Any Pseudo-class */
:matches( h1, h2 ) > p { ... }
:matches( h1, h2 ) > :matches( p, span ) { ... }
/* subject selector */
$ul > li.important:hover {...}
@MichaelKreil
MichaelKreil / Textanalyse - Test 1
Last active December 11, 2015 23:39
Für die #aufschrei-Tweets habe ich mal meinen (längst überfälligen) Textanalyse-Algorithmus fertig gestellt. Dort kann man als Trainingsmenge einige kategorisierte Textschnipsel reinwerfen (z.B. die ersten 100 Tweets). Anschließend kann man dann automatisch weitere Textschnipsel (die letzten 30.000) automatisch Kategorisieren lassen. Das funktio…
Das Format ist immer:
Tweet-Nachricht
vermutete Kategorie (Trefferwahrscheinlichkeit %)
Ich kenne nur sehr feine Männer. Zu den anderen habe ich (Gott sei Dank!) scheinbar keine Resonanz. #aufschrei