This file contains 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.Collections; | |
public class DuplicateToAllScenesMenu : MonoBehaviour { | |
// Add a menu item called "Double Mass" to a Rigidbody's context menu. | |
[MenuItem ("CONTEXT/Transform/DuplicateToAllScenes")] | |
static void DuplicatePlz (MenuCommand command) { | |
EditorApplication.SaveCurrentSceneIfUserWantsTo (); |
This file contains 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 matrix = [ | |
[0, 0, 0, 1, 0, 0, 0], | |
[0, 0, 0, 1, 0, 0, 0], | |
[0, 0, 0, 1, 0, 0, 0], | |
[0, 0, 0, 1, 0, 0, 0], | |
[0, 0, 0, 1, 1, 0, 0], | |
[0, 0, 0, 0, 0, 0, 0] | |
]; | |
This file contains 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 matrix = [ | |
[0, 0, 0, 1, 0, 0, 0], | |
[0, 0, 0, 1, 0, 0, 0], | |
[0, 0, 0, 1, 0, 0, 0], | |
[0, 0, 0, 1, 0, 0, 0], | |
[0, 0, 0, 1, 1, 0, 0], | |
[0, 0, 0, 0, 0, 0, 0] | |
]; | |
This file contains 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 casper = require('casper').create({viewportSize: {width: 960, height: 600}}); | |
var fs = require('fs'); | |
casper.start('https://news.ycombinator.com/', function() { | |
var now = this.fetchText('#hnmain'); | |
var old = fs.read('old.txt'); | |
if (old !== now) { | |
casper.open('http://text-compare.com/', { | |
method: 'post', | |
data: {'text1': old, 'text2': now} |
This file contains 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
// New methods for all functions: mixapply, mixcall, and mixbind | |
// Allows you to force arguments and context even after using .bind | |
// To skip any argument you can use NULL | |
// License: Public Domain | |
(function () { | |
var __bind = Function.prototype.bind; | |
var toArray = function (a) { | |
return Array.prototype.slice.call(a); | |
}; |
This file contains 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 ie = (function(){ | |
var undef, | |
v = 3, | |
div = document.createElement('div'), | |
all = div.getElementsByTagName('i'); | |
do { | |
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->'; | |
} while(all[0]); |
This file contains 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 url = document.location.href; | |
var cdnFallback = /\bcdn=2/.test(url); | |
setTimeout(function(){ | |
if( !window.jQuery && !cdnFallback ) | |
document.location += (/\?/.test(url) ? "&" : "?") + "cdn=2"; | |
},400); | |
if( cdnFallback ){ | |
document.write('<script src="js/jquery-1.8.3.min.js"></scr'+'ipt>'); |
This file contains 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
/************** | |
* Con promesas | |
**************/ | |
var promise = foo().then(function(){ | |
var promise = new Promise(); | |
asyncFunction(function(){ | |
// It has to know there is no need to merge it to a received object in order to | |
// do this; | |
var data = {key1:0x111}; |
This file contains 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
(function () { | |
var addMethod = function (obj, name, fn) { | |
obj[name] = function () { | |
var undef; | |
var result = fn.apply(obj, arguments); | |
if (result === undef) { | |
result = this; | |
} | |
return result; |
This file contains 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
Show hidden characters
[ | |
{ | |
"args": | |
{ | |
"extend": false, | |
"to": "bol" | |
}, | |
"command": "move_to" | |
}, | |
{ |
OlderNewer