Skip to content

Instantly share code, notes, and snippets.

@periode
periode / fetch.rb
Last active March 9, 2021 18:27
Uses the GitHub API to get issues data from the JS styleguide repositories
#!/usr/bin/ruby
require 'octokit'
require 'json'
require 'date'
REPOS = ["airbnb/javascript", "standard/standard", "prettier/prettier"]
client = nil
TIME_LIMIT = DateTime.new(2020,9,1,0,0)
@periode
periode / artwork_list.md
Created December 16, 2020 09:19
list of interactive artwork for exploration
  • sun yuan + peng yu, can't help myself

    • 2016, robot installation
  • nam june paik, tv buddha

    • 1974, video installation
  • christo and jeanne-claude, the floating piers

    • 2016, installation
  • white void, skalar

@periode
periode / OSCManager.cs
Created April 5, 2019 11:48
Unity Communication
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using OscJack;
public class OSCManager : MonoBehaviour {
public float sendVal = 0.0f;
float step = 0.02f;
OscClient client;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ProceduralGenerator : MonoBehaviour {
public GameObject myCube;
public int numCubes;
GameObject[] all_cubes;
@periode
periode / Crawler.js
Created January 22, 2017 12:05 — forked from zacx-z/Crawler.js
100-lines game. Copy and paste the code to the address bar in Chrome and prefix 'javascript:' to change the page you are browsing into a game.
gameMode = false;
var $sel = function (c) { return document.querySelector(c); };
var $$sel = function (doc, c) { return doc.querySelectorAll(c); };
var distance = function (e, b) { return Math.sqrt((e.x + e.size.x / 2 - b.x) * (e.x + e.size.x / 2 - b.x) + (e.y - e.size.y / 2 - b.y) * (e.y - e.size.y / 2 - b.y)); };
var clamp = function (v, a, b) { return Math.min(Math.max(v, a), b); };
var drawCircle = function (ctx, x, y, r, func) {
ctx.beginPath();
ctx.arc(x, y, r, 0, 2 * Math.PI, false);
func.call(ctx);
};
@periode
periode / inject.js
Created September 28, 2016 17:36
octagon-thrasher
<script type='text/javascript'>
setTimeout(function(){
for(e in document.getElementByTagName('img')){
e.style.visibility = 'hidden';
}
var v = document.createElement('video');
v.setAttribute('src', 'http://octagon-exe.com/trailer.mov');
v.setAttribute('style', 'position:absolute;left;50%;top:50%;width:50%;height:50%;');
document.appendChild(v);
}, 1000);
//sockets part, how we establish a connection to the server - when you upload it, you might want to change "localhost" to your ip address
var socket = io.connect('https://localhost:2046');
//simple event listener to make sure we're connected
socket.on('connected', function(){
console.log('connected to socket');
});
//function to be called when the user clicks the save button!
function saveImage(){
//fs - the filesystem module that allow to read/write from the disk
var fs = require('fs');
//sockets - here we connect to our server, you might need to change "httpServer" to something like "app"
var io = require('socket.io').listen(httpServer);
//main event: there is a connection. all of your socket-related code happens within that function
io.sockets.on('connection', function(socket){
//we just log the fact that we have a new user!
<html>
<head>
<!-- INSERT A LINK TO A CSS FILE HERE -->
</head>
<body>
<!-- GIVE A NAME TO THE ID HERE -->
<div id=""></div>
<body>
</html>
@periode
periode / fontSizeTag.cs
Created December 8, 2015 00:23
set a bunch of stuff from tagged objects
void Start(){
GameObject[] gos = GameObject.FindGameObjectsWithTag("ContextText");
int size;
if(ipad){
size = 10;
}else{
size = 12;
}