Skip to content

Instantly share code, notes, and snippets.

View Naatan's full-sized avatar

Nathan Rijksen Naatan

View GitHub Profile
@Naatan
Naatan / disable-reddit-lightbox.userscript.js
Created April 28, 2019 15:23
Disable Reddit Redesign Lightbox (tested on Tampermonkey - Safari)
// ==UserScript==
// @name Disable Reddit Lightbox
// @namespace http://naatan.com/
// @version 0.1
// @description Disable the damn lightbox on the reddit redesign
// @author Nathan Rijksen
// @match https://www.reddit.com/*
// @grant none
// ==/UserScript==
@Naatan
Naatan / gist:5733336
Created June 8, 2013 00:37
Override phabricator "Project" terminology to say "Tags"
translation.override
Current Value: {
"Projects" : "Tags",
"Project" : "Tag",
"Type a project name..." : "Type a tag name...",
"Create a New Project" : "Create a New Tag",
"Create New Project" : "Create New Tag",
"Create Project" : "Create Tag",
"Associate Projects" : "Add Tags",
@Naatan
Naatan / executeAsPHP.js
Last active November 21, 2017 08:07
Komodo Macro - Execute file/selection as PHP
new function()
{
/**
* Execute Macro
*
* @returns {void}
*/
this.exec = function()
{
var tmp = require('tmp');
var fs = require('fs');
var exec = require("child_process").exec;
tmp.file({postfix: ".md"}, function(err, path, fd) {
fs.writeFile(path, "* One\n* Two", function(err) {
if(err) return;
exec('github-markup ' + path, function (err, stdout, stderr) {
console.log(stdout);
console.log(path);
@Naatan
Naatan / fix.github.sidebar.userscript.js
Last active December 8, 2016 16:22
Fix github sidebar
// ==UserScript==
// @name Fix github sidebar
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Fix github's horrible sidebar "improvements"
// @author Naatan
// @match https://github.com/Komodo/KomodoEdit/issues/*
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==
@Naatan
Naatan / ExecuteAsJavaScript.js
Created November 20, 2013 20:48
Komodo Macro - Execute (selection) as JavaScript Quick and dirty, will probably break in many use-cases
komodo.assertMacroVersion(3);
if (komodo.view) { komodo.view.setFocus() };
// Get text to execute
var ke = komodo.editor;
if(!ke.selText)
{
// Use all text in file
var text = ko.views.manager.currentView.scimoz.text.trim()
}
else
@Naatan
Naatan / executeAsPHP.js
Created November 8, 2013 18:09
Komodo Macro API Concept (pseudo-code)
api.macro.register({
id: "executeAsPHP",
execute: function() {
var selection = api.editor.getSelectedContents() || api.editor.getEditorContents();
var tempFile = api.files.writeTempFile(selection);
api.commands.executeAndOutput("php -d display_errors=true " + tempFile.path);
},
@Naatan
Naatan / Convert_Selection_to_Bootstrap_3.js
Last active December 26, 2015 11:28
Komodo Edit/IDE Macro - Convert Bootstrap 2 selection to Bootstrap 3 Based on code from https://github.com/divshot/bootstrap3_upgrader
(function()
{
var selection = ko.views.manager.currentView.selection;
if (selection == "") return;
function convert()
{
selection = selection.replace(/\<\%/g, '&lt;%');
selection = selection.replace(/\%\>/g, '%&gt;');
@Naatan
Naatan / gist:5770489
Last active December 18, 2015 10:39
YouTrack show estimation totals on agile board (userscript)
// ==UserScript==
// @name YouTrack show agile estimation totals
// @namespace http://
// @version 0.1
// @match http://*.myjetbrains.com/*/agile/*
// ==/UserScript==
function run() {
$(".sb-column").each(function(index)
@Naatan
Naatan / lipsum_helper.php
Created April 19, 2013 16:50
Lightweight lipsum generator
<?php
function lipsum($amount = 5, $punct = false)
{
$words = ['lorem', 'ipsum','dolor','sit','amet,','consectetur','adipiscing','elit','praesent',
'iaculis','interdum','congue','cras','ac','dictum','nulla.','quisque','quis','neque',
'nibh','curabitur','consequat','scelerisque','magna,','in','lacinia','nibh',
'scelerisque','eget','in','sed','ante','sit','amet','sem','cursus','mollis',
'quisque','venenatis','velit','nec','felis','varius','eu','auctor','odio',
'scelerisque.','nullam','id','enim','leo','donec','eu','ipsum','non','lectus','dapibus'];