Skip to content

Instantly share code, notes, and snippets.

View gearsdigital's full-sized avatar

Steffen Giers gearsdigital

View GitHub Profile
@gearsdigital
gearsdigital / chatting.js
Created March 31, 2017 20:53 — forked from bmeck/chatting.js
a chat server using generators to manage connection state.
'use strict';
/*::
type Client = Object;
type Channel = string;
*/
const channels/*: Map<Channel, Set<Client>> */ = new Map;
const clients/*: Map<Client, Set<Channel>> */ = new WeakMap;
const join = (name, client) => {
if (!channels.has(name)) {
@gearsdigital
gearsdigital / sticky-nav.js
Created April 27, 2016 12:26 — forked from arielsalminen/sticky-nav.js
Simple sticky nav in plain JS
// Simple sticky nav in plain JS
// p.s. this is just a short example, you should remember to debounce the scroll event ;-)
if ("addEventListener" in window && "classList" in document.documentElement) {
var element = document.getElementById("nav"),
offset = element.offsetTop;
window.addEventListener("scroll", function() {
if (offset < window.pageYOffset) {
element.classList.add("fixed");
@gearsdigital
gearsdigital / SassMeister-input.scss
Created September 17, 2015 06:34
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// Grid settings
$grid-gutter-width: 8px !default;
$grid-columns: 12 !default;
$breakpoints: (xs: 320, sm: 768, md: 1024, lg: 1440);
%clearfix {
@gearsdigital
gearsdigital / SassMeister-input.scss
Created September 2, 2015 20:54
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$columns: 12;
%grid {
float:left;
margin:0 4px;
}
@gearsdigital
gearsdigital / SassMeister-input.scss
Last active September 2, 2015 20:52
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$columns: 12;
%grid {
float:left;
margin:0 4px;
}
@gearsdigital
gearsdigital / SassMeister-input.scss
Created September 2, 2015 20:45
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$total-columns: 12;
%grid {
float:left;
margin:0;
padding:0 2%;
@gearsdigital
gearsdigital / SassMeister-input.scss
Created September 2, 2015 20:30
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// all credits to bootstrap
//
//
// I want to generate something like this:
// http://sassmeister.com/gist/1d3659803d5833e75709
@gearsdigital
gearsdigital / SassMeister-input.scss
Created September 2, 2015 20:27
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// all credits to bootstrap
$grid-columns: 12;
@mixin float-grid-columns($class, $i: 1, $list: ".col-#{$class}-#{$i}") {
@for $i from (1 + 1) through $grid-columns {
@gearsdigital
gearsdigital / SassMeister-input-HTML.html
Created September 2, 2015 20:22
Generated by SassMeister.com.
<h1>Headline</h1>
@gearsdigital
gearsdigital / SassMeister-input-HTML.html
Last active September 2, 2015 20:27
Generated by SassMeister.com.
<h1>Headline</h1>