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 System; | |
using System.Linq; | |
using System.Text; | |
using UnityEngine; | |
public static class CommandCenterReplacement | |
{ | |
/// <summary> | |
/// Returns the test value for this key and user, with different probabilities for each value. | |
/// For example, to have a 40-60 split between the first and second value, you'd pass probabilities as |
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 Sirenix.OdinInspector; | |
using UnityEngine; | |
#if UNITY_EDITOR | |
#endif | |
/// <summary> | |
/// Placed where an obstacle will be spawned when the game loads. | |
/// Used to fake nested prefabs in a pre-2018.3 world. | |
/// </summary> | |
[ExecuteInEditMode] |
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 Sirenix.OdinInspector; | |
using UnityEngine; | |
#if UNITY_EDITOR | |
#endif | |
/// <summary> | |
/// Placed where an obstacle will be spawned when the game loads. | |
/// Used to fake nested prefabs in a pre-2018.3 world. | |
/// </summary> | |
[ExecuteInEditMode] |
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
#if UNITY_IOS | |
using UnityEditor.Callbacks; | |
using UnityEditor; | |
using UnityEditor.iOS.Xcode; | |
using System.IO; | |
public class PostProcessXCodeCalendarFix | |
{ | |
[PostProcessBuild] | |
public static void ChangeXcodePlist(BuildTarget buildTarget, string pathToBuiltProject) |
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 fs = require('fs'); | |
// i'm fairly sure i didn't write this, but i don't remember where i got it | |
// performs a natural sort, so 10 comes after 2. | |
function naturalCompare(a, b) | |
{ | |
var i, codeA, codeB = 1, posA = 0, posB = 0, alphabet = String.alphabet; | |
function getCode(str, pos, code) { | |
if (code) { |
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 fs = require('graceful-fs'), | |
log = require('single-line-log').stdout, | |
crypto = require('crypto'), | |
path = require('path'), | |
async = require('async'); | |
// compute the sha1 hash of the file | |
function hashFile(name, cb) | |
{ | |
var hash = crypto.createHash('sha1'), |
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 fs = require('graceful-fs'), | |
crypto = require('crypto'), | |
path = require('path'); | |
// compute the sha1 hash of the file | |
function hashFile(name, cb) | |
{ | |
var hash = crypto.createHash('sha1'), | |
stream = fs.createReadStream(name); |
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 fs = require('fs'), child_process = require('child_process'); | |
var files = fs.readdirSync('.'); | |
var largeFiles = files.filter(function(f) { | |
// check if the extension of f is jpg, png, or jpeg | |
if(['jpg','png','jpeg'].indexOf(f.split('.').slice(-1)[0].toLowerCase()) == -1) | |
return false; | |
// check that the file is greater than 600K | |
var stat = fs.statSync(f); |
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
<?php | |
$db = new PDO('mysql:host=localhost;dbname=test;charset=utf8', 'root', ''); | |
session_start(); | |
/* | |
CREATE TABLE users ( | |
id INT(9) AUTO_INCREMENT PRIMARY KEY, | |
username VARCHAR(30) UNIQUE KEY, | |
password TEXT); | |
*/ | |
$action = @$_GET['action']; |
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
require 'json' | |
comments = JSON.parse(File.open('comments.json', 'r').read) | |
tips = [] | |
collections = [] | |
custom_tips = [] | |
custom_collections = [] | |
send = /^(.+?), (.+?) wants to send you a Bitcoin tip for ([\d,\.]+) (.+?)\./ |
NewerOlder