Skip to content

Instantly share code, notes, and snippets.

View NV's full-sized avatar

Nikita Vasilyev NV

View GitHub Profile
@visnup
visnup / README.js
Created November 15, 2010 21:36 — forked from igrigorik/webapp.rb
node.js version inspired by igrigorik's any ruby object, as a webapp! 'cause we can too.
#!/usr/bin/env node
var http = require('http')
, webapp = require('webapp');
http.createServer(webapp.bind([])).listen(8000);
// ^^^^^^^^^^^^^^^
// | (x)
// ROFLSCALE DEQUE ---/
@eligrey
eligrey / createStyleSheet.js
Created March 20, 2011 03:24
document.createStyleSheet(rules)
Document.prototype.createStyleSheet = function (rules) {
var stylesheet = this.documentElement.appendChild(
this.createElementNS("http://www.w3.org/1999/xhtml", "style")
).sheet;
stylesheet.insertRule("@media all{" + rules + "}", 0);
return stylesheet;
};
@nzakas
nzakas / es6proxy.htm
Created September 8, 2011 01:02
Example of ES6 Proxy
<!DOCTYPE html>
<!--
This is a simple experiment relying on ECMAScript 6 Proxies. To try this out,
use Aurora (http://www.mozilla.org/en-US/firefox/channel/).
The goal was to create a HTML writer where the method names were really just
the HTML tags names, but without manually creating each method. This uses
a Proxy to create a shell to an underlying writer object that checks each
method name to see if it's in a list of known tags.
@eligrey
eligrey / JS demo DOM tips.md
Created September 17, 2011 18:54
JS demo DOM tips

JS demo DOM tips

A few tips for shaving some bytes off your JS demos. I will probably add more to this list in the future.

Escaping HTML (saves 60-93B, depending on host document type)

26B:

new Option(html).innerHTML
@tj
tj / Makefile
Created September 21, 2011 03:04
index.html: docs/index.md
markdown < $< \
| cat head.html - tail.html \
> $@
@chriseppstein
chriseppstein / 0_silent_selector_grid.scss
Created January 4, 2012 22:08
This gist describes a new feature we're experimenting with for Sass 3.2: placeholder selectors. They do not get generated into your output, but they can be used like a class and extended like one.
$gutter: 10px;
$grid-unit: 60px;
%clearfix {
*zoom: 1;
&:after {
content: "\0020";
display: block;
height: 0;
clear: both;
@subzey
subzey / LICENSE.txt
Created March 22, 2012 22:32 — forked from 140bytes/LICENSE.txt
CSS selector specificity
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 subzey <subzey@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@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;