Skip to content

Instantly share code, notes, and snippets.

@kirs
kirs / gist:984320
Created May 21, 2011 07:01
broken rakefile
require File.expand_path('../config/application', __FILE__)
require 'rake'
Dpp::Application.load_tasks
module ::Dpp
class Application
include Rake::DSL
end
end
anonymous
anonymous / generater.php
Created December 18, 2012 04:43
A random key generater within PHP
function rand_char($length) {
$random = '';
for ($i = 0; $i < $length; $i++) {
$random .= chr(mt_rand(33, 126));
}
return $random;
}
function rand_sha1($length) {
$max = ceil($length / 40);
@josephj
josephj / happy-desinger-mini-1.md
Last active December 18, 2015 10:39
於 HappyDesigner Mini #1 分享會

JavaScript 品質工具:CodePaint 與 Plato

介紹協助提昇 F2E Code Style 的兩個工具。

分享者

josephj@faria

問題

@Leko
Leko / .0_getting_started.md
Last active April 14, 2016 16:06
[DUPLICATED] Macを買ったりリセットしたらやろうリスト
@armollica
armollica / .block
Last active May 31, 2016 02:06
Bubbly Jobs Chart
height: 2500
@emeeks
emeeks / README.md
Last active August 15, 2016 04:40
Particle Edges Dendrogram

Particle edges from d3_glyphEdges are the most difficult edge type to implement. Here's an example using a dendrogram and the connecting paths from the dendrogram. Remember that d3_glyphEdge.mutate.particle mutates the edge data object, spawning new particles, updating the position of existing particles and deleting particles that have reached the end of the path, and it's this array that you use to represent the particles (either with SVG as in this example or, if you're dealing with a lot of particles, probably canvas). As such, an edge object needs to have, along with .source and .target, .frequency (a positive number) to indicate the number of particles created per tick and .particles (an array) to hold the created particles.

d3_glyphEdge.mutate.particle does not include its own tick function so you need to create your own. This example uses d3.timer whereas this network example uses the built-in ti

@paceaux
paceaux / BEMify
Created July 14, 2014 20:41
Stylus BEM mixin
e(name)
&__{name}
{block}
m(name)
&--{name}
{block}
.header
color: red
+e(element)
@curran
curran / .block
Last active January 24, 2017 17:00
Density-based Ticks
license: mit
function withLinkAnalytics(mapPropsToData, WrappedComponent) {
class LinkAnalyticsWrapper extends React.Component {
componentDidMount() {
ReactDOM.findDOMNode(this).addEventListener('click', this.onClick);
}
componentWillUnmount() {
ReactDOM.findDOMNode(this).removeEventListener('click', this.onClick);
}