Skip to content

Instantly share code, notes, and snippets.

View RedHatter's full-sized avatar

Ava Johnson RedHatter

View GitHub Profile
@RedHatter
RedHatter / dead-simple-lightbox.js
Created January 30, 2019 22:43
A very simple zero dependency lightbox.
const css = document.createElement('style')
css.type = 'text/css'
css.innerHTML = `
.dead-simple-lightbox + * {
display: none;
}
.dead-simple-lightbox-container {
display: none;
position: fixed;
@RedHatter
RedHatter / build.sh
Created January 27, 2018 21:05
Gjs doesn't seem to execute Vala constructors. test.js should print 5 but instead it prints 0.
#!/bin/sh
valac gjs_constructor_test.vala -X -fPIC -X -shared -o gjs_constructor_test.so --library=GjsConstructorTest --gir GjsConstructorTest-0.1.gir
g-ir-compiler --shared-library=gjs_constructor_test.so --output=GjsConstructorTest-0.1.typelib GjsConstructorTest-0.1.gir
cp gjs_constructor_test.so /usr/lib/
cp GjsConstructorTest-0.1.typelib /usr/lib/girepository-1.0/
<template>
<div>test</div>
</template>
ERROR in ./public/scripts/display.js
Module not found: Error: Can't resolve 'test.js' in '/home/timothy/Projects/Tools/printmanager-2.0/public/scripts'
resolve 'test.js' in '/home/timothy/Projects/Tools/printmanager-2.0/public/scripts'
Parsed request is a module
using description file: /home/timothy/Projects/Tools/printmanager-2.0/package.json (relative path: ./public/scripts)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /home/timothy/Projects/Tools/printmanager-2.0/package.json (relative path: ./public/scripts)
resolve as module
/home/timothy/Projects/Tools/printmanager-2.0/public/scripts/node_modules doesn't exist or is not a directory
/home/timothy/Projects/Tools/printmanager-2.0/public/node_modules doesn't exist or is not a directory
const path = require('path')
module.exports = {
entry: path.join(__dirname, 'public', 'scripts', 'display.js'),
output: {
path: path.join(__dirname, 'cache', 'scripts'),
publicPath: '/scripts/',
filename: 'display.js'
},
module: {
@RedHatter
RedHatter / fulltextarea.user.js
Created February 24, 2017 19:16
Displays textareas fullscreen in a lightbox.
// ==UserScript==
// @name Full Textarea
// @namespace http://idioticdev.com
// @description Displays textareas in a lightbox.
// @include *
// @version 1
// @grant none
// ==/UserScript==
let areas = document.getElementsByTagName('textarea')
if (areas.length < 1)
@RedHatter
RedHatter / Element.java
Last active September 3, 2016 17:45
A postfix calculator.
import java.util.Queue;
/**
* Base class for all postfix elements.
*/
public interface Element {
/**
* Resolves the element to a number pushing the result onto the stack.
*/
public void resolve (Queue<Double> stack);
@RedHatter
RedHatter / stylus.rb
Last active May 22, 2016 03:19 — forked from sentientwaffle/stylus_converter.rb
Stylus plugin for Jekyll
require 'shellwords'
module Jekyll
class StylusConverter < Converter
safe true
def matches(ext)
ext =~ /\.styl/i
end
// ==UserScript==
// @name Egg Napper
// @namespace idioticdev.com
// @include http*://dragcave.net/locations/*
// @grant none
// @version 1
// ==/UserScript==
var SCROLL = true;
var ONLY_RARES = false;
@RedHatter
RedHatter / sprouted-passwords.user.js
Last active August 13, 2016 17:10
Greasemonkey script that generates and auto fills passwords using the website's domain as the seed. http://idioticdev.com/sprouted-passwords.html
// ==UserScript==
// @name Sprouted Passwords
// @namespace http://idioticdev.com
// @description Generate and autofill passwords using that website's domain as the seed.
// @include *
// @version 1.3
// @require http://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js
// @require http://cdnjs.cloudflare.com/ajax/libs/seedrandom/2.4.2/seedrandom.min.js
// @grant GM_registerMenuCommand
// ==/UserScript==