Skip to content

Instantly share code, notes, and snippets.

@staff0rd
staff0rd / atlas_scaler.js
Created August 26, 2016 02:39
Spine atlas scaler
var fs = require('fs');
var linesToChange = ['size', 'xy', 'orig', 'offset']
function containsChangeLine(line) {
for(var i = 0;i < linesToChange.length; i++) {
if (line.indexOf(linesToChange[i]) > -1) {
return linesToChange[i];
}
}
<?php
// CONFIG: setting this to a post id will TEST ONLY and print results for that post only
// set it to zero to process all posts
$id = 0;
// CONFIG: set to your database config
$mysqli = new mysqli("YOUR_ADDRESS_OR_IP", "YOUR_USER", "YOUR_PASSWORD", "html5forum");
// grab all posts that have <pre> blocks
$sql = "select old.topic_id, old.pid, old.post as old, new.post as new, (LENGTH(old.post) - LENGTH(REPLACE(old.post, '<pre', ''))) / LENGTH('<pre') AS cnt from forums_posts new join orig_posts old ON old.pid = new.pid WHERE (LENGTH(old.post) - LENGTH(REPLACE(old.post, '<pre', ''))) / LENGTH('<pre') > 0";
@staff0rd
staff0rd / User.ts
Created February 7, 2016 12:51 — forked from masahirompp/User.ts
mongoose + typescript
/// <reference path="../tsd/tsd.d.ts" />
import mongoose = require('mongoose');
import passport = require('passport');
interface IUser extends mongoose.Document {
provider: string;
id: string;
authorId: string;
displayName: string;
set out=c:\out\packages\%~nx1
rm -rf %out%
call dnu pack --out %out% %~1
c:\git\nuget.exe push %out%\Debug\* -ApiKey YOUR_API_KEY -Source https://www.myget.org/F/YOUR_FEED_NAME