Skip to content

Instantly share code, notes, and snippets.

@cleary
cleary / 20200917.tidal
Last active February 5, 2022 19:35
tidal practice livestream companion
-- livestream replay:
-- https://www.twitch.tv/videos/743029308
-- https://youtu.be/kliiBKWWy4w
d1 $ stack [
foldEvery [7,8] (0.25 <~ ) $ s "[[<dr_few dr_few*2?> realclaps*4?], [~ cpu:2]]"
] # room 0.3 # sz 0.3
d5 $ silence
@jarmitage
jarmitage / bw.hs
Created May 14, 2020 20:46
[WIP] Tidal to Bitwig OSC API v2
-- Target
:{
bwTarget = Target {oName = "bitwig",
oAddress = "127.0.0.1",
oPort = 8000,
oLatency = 0.2,
oWindow = Nothing,
oSchedule = Pre BundleStamp
}
:}
@mxactvtd
mxactvtd / TidalCyclesQuickReferenceStub.tidal
Last active March 8, 2024 21:19
TidalCycles Quick Reference compiled and partially rewritten documentation from various sources
---- TidalCycles QUICK REFERENCE ----
----------------------------------------------------------------
-- To use in your editor after or alongside your code for quick reference
-- Work in progress, mostly to be used as basis for further documnentation work, sorry for the errors and omissions
-- designed with atom - monokai one dark vivid as theme
-- https://gist.github.com/mxactvtd/bf3fb357a419c7f063b98dfd9a66cf78 - check for update, I keep updating this quite often atm
----------------------------------------------------------------
-- Some sources of Documentation --
-- https://tidalcycles.org/patterns.html
-- https://tidalcycles.org/functions.html
@olvnikon
olvnikon / 1-one-row-expressions.js
Last active April 16, 2019 06:48
Javascript tricky questions. Check yourself. Or destroy any interviewee.
// https://jsfiddle.net/vk35ok2o/50/
console.log('typeof 1/0 => ', typeof 1/0);
console.log('typeof (1/0) => ', typeof (1/0));
console.log('1/0 => ', 1/0);
console.log('"Hello" * 2 => ', "Hello" * 2);
console.log('typeof ("Hello" * 2) => ', typeof ("Hello" * 2));
console.log('typeof "Hello" * 2 => ', typeof "Hello" * 2);
console.log('typeof undefined => ', typeof undefined);
console.log('typeof null => ', typeof null);
console.log('typeof function(){} => ', typeof function(){});
@learncodeacademy
learncodeacademy / webpack.config.js
Created January 8, 2016 03:55
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active July 4, 2024 07:31
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@chantastic
chantastic / on-jsx.markdown
Last active May 30, 2024 13:11
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@paulirish
paulirish / bling.js
Last active July 23, 2024 14:51
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {

Virtual DOM and diffing algorithm

There was a [great article][1] about how react implements it's virtual DOM. There are some really interesting ideas in there but they are deeply buried in the implementation of the React framework.

However, it's possible to implement just the virtual DOM and diff algorithm on it's own as a set of independent modules.