Skip to content

Instantly share code, notes, and snippets.

View tracend's full-sized avatar
🎯
Focusing

✌ Makis Tracend tracend

🎯
Focusing
View GitHub Profile
@clavis-magna
clavis-magna / objectRotation.js
Created November 24, 2012 04:36
local and global rotation functions for THREE.js objects updated for recent revisions of THREE.js
//following two rotation functions are updated versions of code from: https://github.com/mrdoob/three.js/issues/1219
//updated to work in latest versions (r52 tested) of THREE.js
// Rotate an object around an axis in object space
var rotationMatrix
function rotateAroundObjectAxis( object, axis, radians ) {
rotationMatrix = new THREE.Matrix4();
rotationMatrix.makeRotationAxis( axis.normalize(), radians );
object.matrix.multiplySelf( rotationMatrix ); // post-multiply
object.rotation.setEulerFromRotationMatrix(object.matrix, object.order);
@mbostock
mbostock / .block
Last active August 10, 2025 18:05
Force-Directed Graph
license: gpl-3.0
height: 600
redirect: https://observablehq.com/@d3/d3-force-directed-graph
@Radagaisus
Radagaisus / morpheus.jquery.js.coffee
Created October 28, 2012 19:38
Small Morpheus jQuery Plugin
# A wrapper around the morpheus animation library,
# for a jQuery like syntax. Passing the duration
# and callback can work as separate arguments or as
# part of the options object.
#
# Easings can be specified by just writing their name.
#
# - o - the options bag, exactly like morpheus.
# Remember to add easings, as it defaults
# to easeOut.
@danherbert-epam
danherbert-epam / directory.js
Last active October 8, 2016 19:17
Cross-Platflorm node.js directory node module, which includes mkdir and mkdirSync utilities which behave like the UNIX command "mkdir -p" which can be given a path with lots of non-existent nested directories and create any that are missing. One thing missing here that could be added in the future is the optional 'mode' argument, which exists in…
var fs = require('fs');
var pathSep = require('path').sep;
var directory = module.exports = {};
directory.mkdirSync = function __directory_mkdirSync__(path) {
var dirs = path.split(pathSep);
var root = "";
@cigumo
cigumo / texture_atlas.py
Created September 7, 2012 18:56
Texture atlas generator - kalio.net
'''
Texture atlas generator / Kalio.net
klibs commit: 709551bcf617976a19e6105165eda9524007fc08
Copyright 2012 Kalio Ltda.
Requirements:
- PIL: http://www.pythonware.com/products/pil/
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@tracend
tracend / handlebars.localisation.js
Last active October 16, 2018 18:11
Handlebars Localisation Helper #cc
// Handlebars Localisation Helper
// Source: https://gist.github.com/tracend/3261055
Handlebars.registerHelper('l10n', function(keyword) {
var lang = (navigator.language) ? navigator.language : navigator.userLanguage;
// pick the right dictionary (if only one available assume it's the right one...)
var locale = window.locale[lang] || window.locale['en-US'] || window.locale || false;
// exit now if there's no data
if( !locale ) return target;
@brodul
brodul / streaming.sh
Created July 25, 2012 19:39
Twitch.tv script for streaming
#! /bin/bash
# originaly from http://tinyurl.com/twitch-linux from taladan
# www.youtube.com/user/taladan
# gist created by brodul
INRES="1280x800" # input resolution
#OUTRES="1024x640" # Output resolution
OUTRES="800x500" # Output resolution
@ryndel
ryndel / demo.html
Created July 17, 2012 00:48
jquery modulize
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery Modulize</title>
<link rel="stylesheet" href="jquery.modulize.css">
<style>
* {
margin: 0;
padding: 0;
@ryndel
ryndel / demo.html
Created July 17, 2012 00:44
jquery collapse
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery Collapse</title>
<link rel="stylesheet" href="jquery.collapse.css">
<style>
* {
margin: 0;
padding: 0;
@donaldh
donaldh / README.md
Created June 12, 2012 22:36
force-multi-foci with convex hulls

I have modified the force-multi-foci example to add a convex hull around each cluster of nodes.

I achieved this by using d3.nest() to create a new dataset of clusters containing the nodes in each cluster. Then in the tick() method I create and update the path element for each cluster in this dataset.