An updated version of https://gist.github.com/jczaplew/6453048 or http://bl.ocks.org/jczaplew/6453048 using the logic from this example http://mbostock.github.io/d3/talk/20111018/azimuthal.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| float total = 0; | |
| void setup() { | |
| size(400, 400); | |
| } | |
| void draw() { | |
| background(50); | |
| fill(total > 0 ? color(0, 255, 0) : color(255, 0, 0)); | |
| ellipse(width/2, height/2, total, total); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.support.annotation.IntDef; | |
| import java.lang.annotation.Retention; | |
| import static android.view.View.GONE; | |
| import static android.view.View.INVISIBLE; | |
| import static android.view.View.VISIBLE; | |
| import static java.lang.annotation.RetentionPolicy.CLASS; | |
| @Retention(CLASS) |
I hereby claim:
- I am macklinu on github.
- I am macklinu (https://keybase.io/macklinu) on keybase.
- I have a public key ASAMbL_iUc1j5NraqETRUntD7KTF9IK-itXqz80T0WFARgo
To claim this, I am signing this object:
jscodeshift codemod that converts object shorthand syntax
// from this
const person = {
name: function() {
return this.firstName + " " + this.lastName;
}
};
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var person = { | |
| name: "Ben", | |
| print: function() { | |
| var self = this; | |
| console.log(this.name); | |
| (function() { | |
| console.log(this.name); | |
| console.log(self.name); |
Benchmarking the code change in gatsbyjs/gatsby#7909
Example results on my machine:
// Model Name: MacBook Pro
// Model Identifier: MacBookPro14,3
// Processor Name: Intel Core i7
// Processor Speed: 2.8 GHz
// Number of Processors: 1
Performs the following codemod:
- if (module.hot) {
- // any code inside the if statement
- }To run, execute the following command:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /@ | |
| __ __ /\/ | |
| /==\ / \_/\/ | |
| /======\ \/\__ \__ | |
| /==/\ /\==\ /\_|__ \ | |
| /==/ || \=\ / / / /_/ | |
| /=/ /\ || /\ \=\/ / | |
| /===/ / \||/ \ \===\ | |
| /===/ /_________________ \===\ |