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
public static class GrabScreenSwatch { | |
public static Texture GrabScreenSwatch(Rect rect) { | |
int width = (int)rect.width; | |
int height = (int)rect.height; | |
int x = (int)rect.x; | |
int y = (int)rect.y; | |
Vector2 position = new Vector2(x, y); | |
Color[] pixels = UnityEditorInternal.InternalEditorUtility.ReadScreenPixel(position, width, height); |
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
Shader "Hidden/Blur" { | |
Properties { | |
_MainTex ("", 2D) = "white" {} | |
_BlurSize ("", Range(0.0, 1.0)) = 1.0 | |
_Tint ("", Color) = (0.0, 0.0, 0.0, 0.0) | |
_Tinting ("", Range(0.0, 1.0)) = 0.64 | |
} | |
SubShader { |
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
extern crate test; | |
use test::Bencher; | |
use std::fmt::{Show, Formatter, Result}; | |
use std::iter::AdditiveIterator; | |
enum Node<T> { | |
Cons(T, Box<Node<T>>), | |
Nil |
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
diff --git a/tests/rewrite.js b/tests/rewrite.js | |
index e6c85a0..5a6db87 100644 | |
--- a/tests/rewrite.js | |
+++ b/tests/rewrite.js | |
@@ -8,6 +8,33 @@ var libPath = process.env.JSFMT_COV ? 'lib-cov' : 'lib'; | |
var jsfmt = require('../' + libPath + '/index'); | |
describe('jsfmt.rewrite', function() { | |
+ | |
+ it('should test multiline BlockStatement rewrite' ,function() { |
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
--- a/Users/jfleming/Documents/jsfmt/examples/styleGuide.js | |
+++ b/var/folders/xc/lj44vzbd7bgf72wxhktr0f240000gp/T/tmp-66660d8xy3n4.tmp | |
@@ -28,8 +28,8 @@ | |
var anotherFun = function(a, b, c) { | |
// TODO: Should wrap to one line or indent properly | |
return a == "a" || | |
- b == "b" || | |
- c == "c"; | |
+ b == "b" || | |
+ c == "c"; |
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
using UnityEditor; | |
using UnityEngine; | |
using System; | |
using System.Collections; | |
/* | |
Usage: | |
using (new UndoStack("Batch Changes")) { | |
// Make some changes using RecordObject or whatever... |
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
[1mdiff --git a/examples/reduce.js b/examples/reduce.js[m | |
[1mdeleted file mode 100644[m | |
[1mindex ed4cee9..0000000[m | |
[1m--- a/examples/reduce.js[m | |
[1m+++ /dev/null[m | |
[36m@@ -1,4 +0,0 @@[m | |
[31mvar values = [1, 2, 3, 4];[m | |
[31m_.reduce(values, function(sum, value) {[m | |
[31m return sum + value;[m | |
[31m}, 0);[m |
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 subprocess | |
import sublime, sublime_plugin | |
import os | |
PLUGIN_FOLDER = os.path.dirname(os.path.realpath(__file__)) | |
SCRIPT_PATH = PLUGIN_FOLDER + '/node_modules/jsfmt/run.js' | |
NODE_PATH = '/usr/local/bin/node' | |
class FormatJavascript(sublime_plugin.TextCommand): | |
def run(self, edit): |
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
#define INTENSITY 6.5 | |
float blob(vec2 uv, vec2 speed, float time) { | |
// Compute a moving point | |
vec2 point = vec2( | |
sin(speed.x * time), | |
cos(speed.y * time) | |
); | |
float d = 1.0 / distance(uv, point) / INTENSITY; |
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
def unfreezeTransformations(selection): | |
originalCenter = cmds.getAttr('%s.center' % selection)[0] | |
cmds.move(originalCenter[0] * -1, originalCenter[1] * -1, originalCenter[2] * -1, selection, absolute=True) | |
cmds.makeIdentity(selection, apply=True, translate=1, rotate=1, scale=1, normal=0) | |
cmds.move(originalCenter[0], originalCenter[1], originalCenter[2], selection, absolute=True) |