Skip to content

Instantly share code, notes, and snippets.

@jakschu
jakschu / Makefile
Created August 16, 2018 20:40 — forked from ddevault/Makefile
Tiny Wayland compositor
WAYLAND_PROTOCOLS=/usr/share/wayland-protocols
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
xdg-shell-protocol.h:
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h
/**
* CAT
*/
*, *::before, *::after {
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}
.meow {
margin: 0.5em auto 0;
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
(function() {
var hidden = "hidden";
// Standards:
if (hidden in document)
document.addEventListener("visibilitychange", onchange);
else if ((hidden = "mozHidden") in document)
document.addEventListener("mozvisibilitychange", onchange);
else if ((hidden = "webkitHidden") in document)
document.addEventListener("webkitvisibilitychange", onchange);
if(Meteor.isClient){
// set Session variable in method callback
Meteor.call('myMeteorMethod', "foo", function(error, result){
Session.set('myMethodResult', result);
});
// use reactive Session variable in helper
Template.myTemplate.helpers({
myHelper: function(){
if(Meteor.isServer){
Meteor.methods({
myMeteorMethod: function() {
// load Future
Future = Npm.require('fibers/future');
var myFuture = new Future();
// call the function and store its result
SomeAsynchronousFunction("foo", function (error,results){
@jakschu
jakschu / e_stack.js
Created February 22, 2013 18:06
error.stack
function a() {
document.write("inside a.\n");
return d;
}
try {
a();
} catch (e) {
document.write("<p>" + e.stack + "</p>");
// or console.log(e.stack);
}
@jakschu
jakschu / index.html
Created February 21, 2013 05:36
A CodePen by jakschu.
<h1><a href="http://blokkfont.com/" target="_blank">BLOKK font &rarr;</a></h1>
<section class="main-content" role="main">
<article>
<h2>Dogs and Cats, Living Together</h1>
<p>Yep vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
@jakschu
jakschu / index.html
Created February 20, 2013 19:21
A CodePen by Joey Hoer. SVG Semi-Conical Gradient - SVG semi-conical gradient in CSS with SCSS
<div>
<h1>L<span>o</span>ading</h1>
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Email</th>
<th scope="col">Dept, Title</th>
<th scope="col">Phone</th>
</tr>
</thead>
<tbody>