Skip to content

Instantly share code, notes, and snippets.

View XVicarious's full-sized avatar

Brian Maurer XVicarious

  • Buffalo, NY, USA
View GitHub Profile
@XVicarious
XVicarious / autoCookieClicker.js
Last active October 5, 2017 00:54
I've taken this game too far
const head = document.getElementsByTagName('head')[0];
const jQuery = document.createElement('script');
jQuery.type = 'text/javascript';
jQuery.src = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-beta1/jquery.min.js';
let ogLength = 0;
const jQCode = function() {
const badUpgrades = [74, 84, 85, 182, 183, 184, 185, 209, 332, 333, 361];
/* [buildingId, multiplier] */
const upgradeEffect = [
[[0], [0, 1, 2], 2],
@XVicarious
XVicarious / Javascript ISO country code to country name conversion
Created June 29, 2017 00:37 — forked from maephisto/Javascript ISO country code to country name conversion
ISO 3166-1 alpha-2 country code to country name conversion with a simple Javascript implementation, an array and a function.
var isoCountries = {
'AF' : 'Afghanistan',
'AX' : 'Aland Islands',
'AL' : 'Albania',
'DZ' : 'Algeria',
'AS' : 'American Samoa',
'AD' : 'Andorra',
'AO' : 'Angola',
'AI' : 'Anguilla',
'AQ' : 'Antarctica',
__module_name__ = "IrmageBoard"
__module_version__ = "0.5.5"
__module_description__ = "Liek a real imageboard guies (without the images!!!1)"
tinyVersion = 55
import xchat, string, re, random, yaml
from urllib2 import urlopen
ymlFilter = urlopen("http://xvicario.us/irmageboard/filters.yml")
myFilter = yaml.load(ymlFilter)
//META{"name":"MemeArrowsLite"}*//
function MemeArrowsLite() {
/**
* Runs the converting of ">text" to green text, or "MemeArrows"
*/
function modifier() {
$('.message-text>.markup:not(.green-text)').each(function() {
if ($(this).text().substr(0, 1) === '>') {
$(this).addClass('green-text');
}
@XVicarious
XVicarious / ConvertCost.js
Created March 29, 2017 17:59
Convert {G}, etc to the proper mana symbols for mana.css
var ConvertCost = {
colorCodes: ['W', 'U', 'B', 'R', 'G', 'C', 'X', 'Y', 'Z', 'P', 'T'],
// todo: this needs support for infinity symbols, and tap symbols
parse: function (string) {
var idChars = ['/', '{', '}']; // characters we don't want to add to our build
if (string == null || !string.trim()) { // if the string is null or empty
return ''; // we are already done, return an empty string
}
var newFangledString = ''; // our new mana cost representation
var build = ''; // for our longer identifiers we need to build up to it
@XVicarious
XVicarious / connection.php
Last active March 28, 2017 23:42
Get the top cards of the format
<?
/**
* @param int $formatId id of the format to fetch cards for
* @param string[] $types what types of cards you want
* @param int $limit how many of the top cards you want
* @return [] array of size $limit of cards
*/
public static function getTopCards($formatId, $types = [], $limit = 10)
{
@XVicarious
XVicarious / pucaGains.js
Created March 11, 2016 21:46
Just pop this in a bookmarklet and fire it off on https://pucatrade.com/trades/past/received or https://pucatrade.com/trades/past/sent to see your gains.
javascript:(function(){var total=0;$($("tr td:nth-child(5) div span").get().reverse()).each(function(){var thisT=$(this).text().substring(2);thisT=thisT.substring(0,thisT.length-1);total+=Number.parseInt(thisT);});alert(total);})();
// The lower the number on /sent the better (this means negative!)
// The higher the number on /received the better (postitive)
public HashMap<Character, Integer> getCharacterCounts() {
HashMap<Character, Integer> tweetCharacters();
//iterate through tweets
//for each character in string
if (tweetCharacters.containsKey(/*CHARACTER*/)) {
tweetCharacters.put(/*CHARACTER*/, tweetCharacters.get(/*CHARACTER*/) + 1);
} else {
tweetCharacters.put(/*CHARACTER*/, 1);
}
//end for