Skip to content

Instantly share code, notes, and snippets.

@alecgorge
alecgorge / highcharts2png-bookmarklet.js
Created April 18, 2012 22:23
Go to the print friendly version on anything using HighCharts and run the bookmarklet. It will turn all the SVGs into copyable PNGs.
javascript:(function(a){var b=function(){a(".highcharts-container svg").map(function(){var b=a(this).parent(),c=b.html();b.html(""),a("<canvas></canvas>").css("width",b.css("width")).css("height",b.css("height")).appendTo(b);var d=b.find("canvas")[0];canvg(d,c,{ignoreMouse:!0,ignoreAnimation:!0,renderCallback:function(){var a=d.toDataURL("image/png");b.html('<img src="'+a+'"/>')}})})};if(typeof window.canvg!="undefined"){b();return}var c=["http://canvg.googlecode.com/svn/trunk/rgbcolor.js","http://canvg.googlecode.com/svn/trunk/canvg.js"];a.getScript(c[0],function(){a.getScript(c[1],function(){b()})})})(jQuery)
@alecgorge
alecgorge / bookmarklet.js
Created February 2, 2012 03:36
fix the terrible calc chat ui
javascript:(function(){var a=loadSolution,b=!1,c=function(){b||(b=$("#loader-img")),b.show()},d=function(){b.hide()};loadSolution=function(){c(),a.apply(null,arguments)},$("#book-content-center,#book-content-right,#bottom-toolbar").remove(),$("#left-content-container,#book-content-left").css({width:"auto",height:"auto","float":"none",display:"block",overflow:"visible"}),$("<button>Next Problem</button>").click(function(){return $("#selExercises")[0].selectedIndex++,loadSolution(),!1}).appendTo($("#toolbar")),$("<button>Previous Problem</button>").click(function(){return $("#selExercises")[0].selectedIndex--,loadSolution(),!1}).appendTo($("#toolbar")),$("<span></span>").attr("id","loader-img").html(" &nbsp;&nbsp;Loading...").hide().appendTo($("#toolbar")),$("#solutionimg").load(d)})()
/*
NppFTP: FTP/SFTP functionality for Notepad++
Copyright (C) 2010 Harry (harrybharry@users.sourceforge.net)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@alecgorge
alecgorge / stuff.cpp
Created January 17, 2012 00:53
notepad++ nppftp decryption routine
// Encryption.cpp
#include <openssl/des.h>
char * Encryption::_DefaultKey = NULL;
bool Encryption::_IsDefaultKey = true;
const char * defaultString = "NppFTP00"; //must be 8 in length
const size_t Encryption::KeySize = 8;
int Encryption::Init() {
_DefaultKey = new char[KeySize];
# npm install jitsu -g
npm ERR! TypeError: Bad argument
npm ERR! at Object._open (fs.js:224:11)
npm ERR! at open (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:73:6)
npm ERR! at Object.open (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:67:3)
npm ERR! at Object.lutimes (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:28:6)
npm ERR! at setProps (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:267:18)
npm ERR! at Object.oncomplete (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:205:7)
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
[alec@server node-v0.6.3]# npm
npm ERR! Error: ENOENT, no such file or directory '/usr/local/lib/node_modules/npm/man/man1/'
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR!
npm ERR! System Linux 2.6.18-194.17.1.el5.028stab070.7
npm ERR! command "node" "/usr/local/bin/npm"
npm ERR! cwd /tmp/node-v0.6.3
@alecgorge
alecgorge / consoleoutput.txt
Created November 30, 2011 22:37
Jitsu on Windows.
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\Users\Alec> node -v
v0.6.3
PS C:\Users\Alec> npm install jitsu -g
C:\Program Files (x86)\nodejs\jitsu -> C:\Program Files (x86)\nodejs\node_modules\jitsu\bin\jitsu
colors@0.5.1 C:\Program Files (x86)\nodejs\node_modules\jitsu\node_modules\colors
ncp@0.1.2 C:\Program Files (x86)\nodejs\node_modules\jitsu\node_modules\ncp
eyes@0.1.6 C:\Program Files (x86)\nodejs\node_modules\jitsu\node_modules\eyes
{
"as_of": "Wed, 18 May 2011 22:35:04 +0000",
"trends": [{
"url": "http:\/\/search.twitter.com\/search?q=%23itshardwhen",
"name": "#itshardwhen"
}, {
"url": "http:\/\/search.twitter.com\/search?q=%23myfavoriteartist",
"name": "#myfavoriteartist"
}, {
"url": "http:\/\/search.twitter.com\/search?q=%23thatstheone",
@alecgorge
alecgorge / java-properties.php
Created May 18, 2011 00:29
Parse Java properties files in PHP
<?php
function parse_properties($txtProperties) {
$result = array();
$lines = split("\n", $txtProperties);
$key = "";
$isWaitingOtherLine = false;
foreach ($lines as $i => $line) {
if (empty($line) || (!$isWaitingOtherLine && strpos($line, "#") === 0))
continue;
2011-02-27 13:58:48 [INFO] alecgorge [/127.0.0.1:57726] logged in with entity id
249
java.lang.NoSuchMethodError: OPlayerManager.a(LOPlayerManager;)Lnet/minecraft/se
rver/MinecraftServer;
at OPlayerInstance.<init>(SourceFile:31)
at OPlayerManager.a(OPlayerManager.java:29)
at OPlayerManager.a(OPlayerManager.java:56)
at OServerConfigurationManager.a(OServerConfigurationManager.java:78)
at ONetLoginHandler.b(SourceFile:114)
at ONetLoginHandler.a(SourceFile:37)