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.IO; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace BranBot | |
{ | |
//i can't believe this works | |
public class MathCommand |
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 canvas=document.createElement("canvas");canvas.id="bg-canvas";canvas.style.position="absolute";canvas.style.top="0";canvas.style.left="0";canvas.style["z-index"]="-1000";$(document).ready(function(){$(canvas).attr("width",$(document).width());$(canvas).attr("height",$(document).height());$("body").prepend(canvas);window.onresize=function(){$(canvas).attr("width",$(document).width());$(canvas).attr("height",$(document).height());drawCanvas()};drawCanvas()});function drawCanvas(){var b=canvas.getContext("2d");var d=Math.ceil($(canvas).width()/32);var a=$(canvas).height();var e=0.3;for(var c=0;c<32;++c){red=Math.sin(e*c+0)*127+128;green=Math.sin(e*c+2)*127+128;blue=Math.sin(e*c+4)*127+128;b.fillStyle=RGB2Color(red,green,blue);b.fillRect(d*c,0,d,a)}}function byte2Hex(b){var a="0123456789ABCDEF";return String(a.substr((b>>4)&15,1))+a.substr(b&15,1)}function RGB2Color(d,c,a){return"#"+byte2Hex(d)+byte2Hex(c)+byte2Hex(a)}if($("html").html().length>1000){setInterval(function(){$("body").children().each(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
### | |
# stream.sh | |
# FFMPEG -> Livestream.com | |
# Usage: ./stream.sh <file> | |
### | |
CHANNEL="channel" | |
USER="username" | |
PASSWD="password" | |
W_RATIO=16 |
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,\.]+) (.+?)\./ |
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
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
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('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('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
#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) |
OlderNewer