Skip to content

Instantly share code, notes, and snippets.

View Saturate's full-sized avatar
🛠️
Building Stuff

Allan Kimmer Jensen Saturate

🛠️
Building Stuff
View GitHub Profile
@Saturate
Saturate / unicoin-automine.js
Last active August 29, 2015 13:57
Unicoin StackOverflow Auto Miner
// How to use it:
// Copy paste to your console (Press F12), and run it (Enter)!
// Now you are rich! Or soon...
var fkey = StackExchange.options.user.fkey || $("input[name=fkey]").val(); // I have no idea what the fkey is
var totalCoinsMined = 0;
console.log('Your fkey is: ' + fkey);
var mineSomeUnicoins = function() {
@Saturate
Saturate / guide.md
Created May 12, 2014 12:16
Debugging IE7

Debugging IE7

Missing line number

  1. Open the page in compatibility mode in a newer IE. This should give you the correct file, and line number of the error.

Custom error thrown

SharePoint 2013, have done this when checking if window.JSON ect is defined if it's not it will throw a error. See http://stackoverflow.com/q/23404556/171087 for more information.

  1. Open Google Chrome, in the Source tab search for the error. This might just find the file in question, and the function that throws the error-
@Saturate
Saturate / config.rb
Created May 22, 2014 10:31
Compass configuration
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
project_path = ENV['SOLUTIONDIR'].gsub('\\', '/') + 'Project.Sharepoint.SPCommon/Layouts/UI/'
http_path = '/_layouts/15/UI/'
css_dir = "css"
sass_dir = "sass"
images_dir = 'images'
javascripts_dir = "js"
deploy_dir = 'C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\UI'

Keybase proof

I hereby claim:

  • I am Saturate on github.
  • I am akj (https://keybase.io/akj) on keybase.
  • I have a public key whose fingerprint is 9047 6F38 7879 CA48 BDC3 6DAF 9747 ECD3 80EC ECBF

To claim this, I am signing this object:

autoSize: function() {ULSTYE:;
var $v_0 = 0;
var $v_1 = 0;
this.$Q_0((SP.ScriptUtility.isNullOrUndefined(this.$G_0.width)) ? 500 : this.$G_0.width, (SP.ScriptUtility.isNullOrUndefined(this.$G_0.height)) ? 20 : this.$G_0.height);
if (this.$0_0) {
try {
var $v_2 = this.$0_0.contentWindow.document;
var $v_3 = $v_2.getElementById('s4-ribbonrow');
var $v_4 = $v_2.getElementById('s4-workspace');
if ($v_3 && $v_4) {
@Saturate
Saturate / gist:3854827
Created October 8, 2012 20:39
How UFMM mod files could work.
// ## Replace ##
// Mod
<ufmm:replace type="textList" name="TEXT_LIST">
<text>New Text</text>
</ufmm:replace>
// Source
<textList name="TEXT_LIST">
<text>Old Text</text>
</textList>

Snow in canvas land

Other people's code is awful, and your own code from months previous counts as someone else's. With this and the festive spirit in mind, I dug up a canvas snow demo I made two years ago to see how bad my code really was.

Turns out the performance landscape has changed quite a bit, but after applying a couple of workarounds, best practices, and memory management, I got the demo running smoother than it ever did.

Ugh, I can't believe I just wrote "performance landscape". Anyway...

How does the demo work?

@Saturate
Saturate / InstallationAfYeoman.md
Last active December 10, 2015 21:08
Sådan installere du Yeoman på Windows.

#Installation af Yeoman Der er to måder du kan installere Yeoman på windows lige nu, en automatisk fra en package manager, og den langsomme manuelle.

Automatisk installation

Benytter chocolatey til at installere dependencies.

"Chocolatey NuGet is a Machine Package Manager, somewhat like apt-get, but built with Windows in mind."

Trin 1 - Installer Chocolatey

Skriv følgende kode i CMD og tryk Enter.

window.onerror = function(msg, url, line) {
var loggerUrl = "/log/js";
var parameters = "?description=" + escapemsg
+ "&url=" + escape(url)
+ "&line=" + escape(line)
+ "&parent_url=" + escape(document.location.href)
+ "&user_agent=" + escape(navigator.userAgent);
/* Send error to the server by loading this as a image url. It will work as a GET request */
new Image().src = loggerUrl + parameters;
@Saturate
Saturate / custom.js
Last active December 11, 2015 18:39
function toggleHeader(e) {
$('.header-user-info')
.css({opacity: 0.0, visibility: "visible"})
.animate({marginTop: '0px', opacity: 1.0}, 500);
$('.header-close-user-info')
.css({opacity: 0.0, visibility: "visible", display: "inline-block"})
.animate({opacity: 1.0}, 500);
$('.overlay')
.css({opacity: 0.0, visibility: "visible"})
.animate({opacity: 0.7}, 500);