Skip to content

Instantly share code, notes, and snippets.

💭
im just gonna move to gogs

cpancake

💭
im just gonna move to gogs
  • Worcester, MA
Block or report user

Report or block cpancake

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CommandCenterReplacement.cs
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
View ObstaclePlaceholder.cs
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]
View gist:7f36a015c7cea24bdb94d40951ea5f84
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]
View PostProcessXCodeCalendarFix.cs
#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)
View sequencer.js
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) {
View dedup.js
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'),
View dechanify.js
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);
View makesmaller.js
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);
View user.php
<?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'];
View analyze.rb
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,\.]+) (.+?)\./
You can’t perform that action at this time.