Swift code to change the Wallpaper for all screens. Currently, it changes only the current spaces' wallpaper. I'm working on a version to change in all spaces.
Usage: WallpaperChanger "/Users/username/SomeFolder/SomePicture.jpg"
<!doctype html> | |
<meta charset="utf-8"> | |
<body> | |
<script src="//d3js.org/d3.v4.min.js"></script> | |
<script> | |
let margin = {top: 100, right: 100, bottom: 100, left: 100}; | |
let width = 960, | |
height = 500, |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
/*jshint node:true*/ | |
var http = require('http'); | |
var fs = require('fs'); | |
var url = require('url'); | |
var querystring = require('querystring'); | |
var head = fs.readFileSync('head.html','UTF-8'); | |
//<head> | |
// <meta charset="utf-8"> |
var fs = require('fs'); | |
var path = require('path'); | |
var _ = require('lodash'); | |
module.exports = function ForceCaseSensitivityPlugin() { | |
this.plugin('normal-module-factory', function(nmf) { | |
nmf.plugin('after-resolve', function(data, done) { | |
var parentDir = path.dirname(data.resource); | |
var resourceName = path.basename(data.resource); | |
fs.readdir(parentDir, function(err, files) { |
While I was experimenting with animation, I had to make a few basic prototypes for a layout system and see how they intertwine. Here's the API in conjunction with React:
var MyComp = React.createClass({
registerLayoutValues: function() {
return {
self: {
width: 30,
left: (get('parent', 'width') - get('self', 'width')) / 2 // Center.
}
Interesting part (unmounting & API) is at the end if you're not interested in the rest =).
This animation proposal is just an attempt. In case it doesn't work out, I've gathered a few examples that can test the power of a future animation system.
Parent is an infinitely spinning ball, and has a child ball that is also spinning. Clicking on the parent causes child to reverse spinning direction. This tests the ability of the animation system to compose animation, not in the sense of applying multiple interpolations to one or more variables passed onto the child (this should be trivial), but in the sense that the parent's constantly updating at the same time as the child, and has to ensure that it passes the animation commands correctly to it. This also tests that we can still intercept these animations (the clicking) and immediately change their configuration instead of queueing them.
Typing letters and let them fly in concurrently. This tests concurrency, coordination of an array of ch
$(function() { | |
// good opportunity to combine into a single statement | |
// qq w cw <esc> A, <esc> 0 j q | |
var a = 10; | |
var b = 20; | |
var c = 30; | |
var d = 40; | |
var e = 50; | |
// opportunity to simplify syntax |
#ifdef GL_ES | |
precision highp float; | |
#endif | |
uniform sampler2D from, to; | |
uniform float progress; | |
uniform vec2 resolution; | |
float snoise(vec3 uv, float res) // by trisomie21 | |
{ | |
const vec3 s = vec3(1e0, 1e2, 1e4); |
#ifdef GL_ES | |
precision highp float; | |
#endif | |
// General parameters | |
uniform sampler2D from; | |
uniform sampler2D to; | |
uniform float progress; | |
uniform vec2 resolution; | |