This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Mastodon full width columns | |
// @namespace http://isobeef.org/ | |
// @version 0.1 | |
// @description Mastodon full width columns | |
// @author rash <[email protected]> | |
// @updateUrl https://gist.github.com/rashfael/b0fa9c7ffff1cf44bc7639269440a026/raw/mastodon-full-width-columns.user.js | |
// @downloadUrl https://gist.github.com/rashfael/b0fa9c7ffff1cf44bc7639269440a026/raw/mastodon-full-width-columns.user.js | |
// @match https://chaos.social/web/* | |
// @grant GM_addStyle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Backup script to save important IsoBeef data on Hetzner's backup service. | |
# | |
# Usage: | |
# ./backup | |
# | |
# Written by BOFH Lyse, licensed under WTFPL. | |
# | |
# References: | |
# http://www.nongnu.org/rdiff-backup/examples.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function snakeToCamel(str) { | |
var parts = str.split('_'); | |
return parts.reduce(function (p, c) { | |
return p + c.charAt(0).toUpperCase() + c.slice(1); | |
}, parts.shift()); | |
} | |
function toCamelCase(object, exceptions) { | |
exceptions = exceptions || []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
CREATE PROCEDURE create_user(username TEXT, passwordhash TEXT) | |
BEGIN | |
DECLARE temp TEXT; | |
SELECT user FROM mysql.user WHERE user = username INTO temp; | |
IF temp = username THEN | |
SIGNAL SQLSTATE '45002' SET MESSAGE_TEXT = 'username already exists'; | |
ELSE | |
SET @s = CONCAT('CREATE USER \'', username, '\'@localhost IDENTIFIED BY PASSWORD \''+passwordhash+'\''); | |
PREPARE stmt_create FROM @s; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name soup.io always nsfw | |
// @namespace http://isobeef.org | |
// @version 0.1 | |
// @description always shows all the unsafe pictures on soup | |
// @author rashfael | |
// @match http://*.soup.io/* | |
// @exclude http://*.soup.io/remote/* | |
// @exclude http://*.soup.io/frames | |
// @grant none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = class ReportController extends Controller | |
historyURL: 'reports' | |
index: -> | |
collection = new Reports() | |
collection.fetch() | |
@view = new ReportListView | |
collection: collection | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mixin textfield(options) | |
.control-group | |
label.control-label(for=options.name)= options.label | |
.controls | |
div(class=options.append ? 'input-append' : '') | |
- var classArr = []; | |
- if(options.size) | |
- classArr.push(options.size); | |
- else | |
- classArr.push('span8'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = class Crud | |
constructor: (app) -> | |
app.get "/api/#{@prefix}", @list | |
app.post "/api/#{@prefix}", @add | |
app.get "/api/#{@prefix}/:id", @item | |
app.put "/api/#{@prefix}/:id", @update | |
app.delete "/api/#{@prefix}/:id", @delete | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{exec} = require 'child_process' | |
{spawn} = require 'child_process' | |
{fork} = require 'child_process' | |
os = require 'os' | |
if os.platform() is 'win32' | |
coffee = 'coffee.cmd' | |
brunch = 'brunch.cmd' | |
else | |
coffee = 'coffee' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongoose = require 'mongoose' | |
TestSchema = new mongoose.Schema { | |
number: | |
type: Number | |
set: (x) -> return x/2 | |
get: (x) -> | |
console.log 'getter called with undefined' if not x? | |
x*2 if x? | |
} |