Skip to content

Instantly share code, notes, and snippets.

@thijstriemstra
thijstriemstra / README.md
Last active July 31, 2023 13:01 — forked from savetheclocktower/README.md
Using a potentiometer as a volume control for the Raspberry Pi
@bendc
bendc / holy-grail.html
Last active December 15, 2017 19:50
Holy Grail Layout using CSS Grid
<!doctype html>
<title>Holy Grail Layout</title>
<style>
body {
display: grid;
grid-template-rows: 100px 1fr 100px;
grid-template-columns: 200px 1fr 200px;
min-height: 100vh;
margin: 0
@idibidiart
idibidiart / GraphQL-Architecture.md
Last active September 16, 2023 18:36
Building an Agile, Maintainable Architecture with GraphQL

Building a Maintainable, Agile Architecture for Realtime, Transactional Apps

A maintainable application architecture requires that the UI only contain the rendering logic and execute queries and mutations against the underlying data model on the server. A maintainable architecture must not contain any logic for composing "app state" on the client as that would necessarily embed business logic in the client. App state should be persisted to the database and the client projection of it should be composed in the mid tier, and refreshed as mutations occur on the server (and after network interruption) for a highly interactive, realtime UX.

With GraphQL we are able to define an easy-to-change application-level data schema on the server that captures the types and relationships in our data, and wiring it to data sources via resolvers that leverage our db's own query language (or data-oriented, uniform service APIs) to resolve client-specified "queries" and "mutations" against the schema.

We use GraphQL to dyn

@vinceallenvince
vinceallenvince / README.md
Last active February 28, 2021 01:21
Set up an SD Card for Raspberry Pi Audio projects

#Set up an RPi Audio project

Use the following instructions to prepare your RPi's SD Card for an audio project.

###Install an operating system. You first need to install an operating system on your RPi. Raspian should work fine. If you're using a monitor, keyboard and mouse, using an install manager is the easiest way. Just follow the instuctions for installing NOOBS.

If you are developing headless, follow the instructions for downloading and installing Raspian. You'll also need to login via ssh or a console cable. If you're on Yosemite on a Mac, [this post](http://zittlau.ca/fix-usb-serial-console-on-raspberry-

@scripting
scripting / gist:828144d4a9dda203164c
Created August 19, 2014 22:22
A routine that updates a Facebook post.
function fbUpdatePost (idPost, thePostText) {
FB.api (idPost, "post", {message: thePostText}, function (response) {
console.log ("fbUpdatePost: response == " + JSON.stringify (response, undefined, 4));
});
}
@hdragomir
hdragomir / sm-annotated.html
Last active June 13, 2024 03:01
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@lukehoban
lukehoban / es6features.md
Last active December 6, 2019 01:50
ECMAScript 6 Features

Note: Up to date version now at https://github.com/lukehoban/es6features

ECMAScript 6

Introduction

ECMAScript 6 is the upcoming version of the ECMAScript standard. This standard is targetting ratifcation in December 2014. ES6 is a significant update to the language, and the first update to the language since ES5 was standardized in 2009. Implementation of these features in major JavaScript engines is underway now.

See the draft ES6 standard for full specification of the ECMAScript 6 language.

ES6 includes the following new features:

@ThrivingKings
ThrivingKings / Retinaizer.css
Created August 1, 2013 20:21
Use JavaScript and CSS to quickly upgrade your images for Retina displays (Retinaizer)
div {
background: url('/img/background.jpg');
}
@media only screen and (-webkit-min-device-pixel-ratio: 2) {
div {
background-image: url('/img/background@2x.jpg');
background-size: 100px 100px;
// This should match the dimensions of the original resolution image
@daneden
daneden / css-starter.sublime-snippet
Created July 29, 2013 08:33
The starter stylesheet I use for nearly all my projects these days. Includes a Sublime Text snippet, activated by typing `css.starter` and hitting tab. Spits out the contents of s.css. Enjoy!
<snippet>
<content><![CDATA[
/*-----------------------------------*\
\$RESET
Blanket reset. For something less
volatile, I’d recommend Eric
Meyer’s reset.
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 30, 2024 19:21
5 entertaining things you can find with the GitHub Search API