Skip to content

Instantly share code, notes, and snippets.

@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@ybakos
ybakos / ds_algo_books.txt
Created October 19, 2013 16:37
Data Structures & Algorithms Books. Ordered by increasing density.
Miller, B. & Ranum, D. (2011). Problem Solving with Algorithms and Data Structures Using Python.
Reed, D. & Zelle, J. (2009). Data Structures and Algorithms: Using Python and C++.
Goldman, S. & Goldman, K. (2007). A Practical Guide to Data Structures and Algorithms using Java.
Penton, R. (2002). Data Structures for Game Programmers.
Skeina, S. (2008). The Algorithm Design Manual.
Sedgewick, R. (2002) Algorithms in C++.
@progrium
progrium / gist:5737696
Last active December 18, 2015 06:09
Plans to break out AsyncManager from Ginkgo as standalone project for standard interface / tools / conveniences when working with gevent, Eventlet, threading, or even multiprocessing.

Ginkgo Async

Extracted Async Manager from Ginkgo as standalone project. At the very least it provides a common interface / abstraction for Gevent and Eventlet, but also for multi-threading and multi-processing.

Using Ginkgo Async interface

# easy async global singleton object

from ginkgo.async import async

@johnpolacek
johnpolacek / lazyloadimages.js
Last active December 17, 2015 14:59
Lazy Load Images
// <a href="product.html" data-lazy-image="product.jpg" data-lazy-image-alt="The Product"></a>
;(function($) {
$('*[data-lazy-image]').each(function() {
var alt = $(this).attr('data-lazy-image-alt') === undefined ? '' : 'alt="'+$(this).attr('data-lazy-image-alt')+'"';
$(this).append($('<img src="'+$(this).attr('data-lazy-image')+'" '+alt+'" />'));
});
}(jQuery));
@functionite
functionite / gist:5604962
Last active December 17, 2015 11:49
how many of node.js developers are aware of that?
var http = require('http');
var counter = 0;
var server = http.createServer(function(req, res){
var then = +new Date() + 9000;
if (counter == 0) {
while(+(new Date()) < then) {
}
counter = 1;
res.end("oh, hi");
} else {
@norcross
norcross / url-spamcheck.php
Created April 26, 2013 17:41
checks the URL posted by a commenter
<?php
function rkv_url_spamcheck( $approved , $commentdata ) {
$author_url = $commentdata['comment_author_url'];
$author_url_length = strlen($author_url);
if ($author_url_length > 50 )
$approved = 'spam';
@maxw3st
maxw3st / index.html
Created March 23, 2013 17:00
A CodePen by Chris Coyier. Animated back-to-top button - I used this form constructed with CSS3 as a separator between different sections of a one-pager and discovered that I could use a litte hover-effect to make it a back-to-top button.
<a href="#top" class="diamond-wrap"><span class="diamond">back to top</span></a>
@rodneyrehm
rodneyrehm / anti-keygrabber.user.js
Last active July 5, 2022 01:31
GreaseMonkey: Prevent Web Applications From Grabbing Certain HotKeys
// ==UserScript==
// @name anti key-grabber
// @description Prevent web apps from capturing and muting vital keyboard shortcuts
// @grant none
// @version 1.1
// ==/UserScript==
(function(){
var isMac = unsafeWindow.navigator.oscpu.toLowerCase().contains("mac os x");
unsafeWindow.document.addEventListener('keydown', function(e) {
if (e.keyCode === 116) {
@Integralist
Integralist / regex.js
Created March 11, 2013 15:15
The difference between JavaScript's `exec` and `match` methods is subtle but important, and I always forget...
var str = "The quick brown fox jumped over the box like an ox with a sox in its mouth";
str.match(/\w(ox)/g); // ["fox", "box", "sox"]
// match (when used with a 'g' flag) returns an Array with all matches found
// if you don't use the 'g' flag then it acts the same as the 'exec' method.
str.match(/\w(ox)/); // ["fox", "ox"]
/\w(ox)/.exec(str); // ["fox", "ox"]
@maxw3st
maxw3st / index.html
Created December 17, 2012 00:20
A CodePen by Rachel Nabors. Clipping Masquerade - Playing about with CSS clipping masks. Webkit browsers only for now, I'm afraid!
<div class="lady">
</div>
<!--
You can do it, too: http://css-tricks.com/webkit-image-wipes/
Theme song: "Hold the Night" by Lyre Le Temps
Still need a name for her. Suggestions welcome!
-->