Skip to content

Instantly share code, notes, and snippets.

Avatar

Florian Margaine ralt

View GitHub Profile
@ralt
ralt / 000.mkd
Created Feb 25, 2018 — forked from packz/000.mkd
Static cryptsetup
View 000.mkd

I suppose you use Debian-like systems

$ mkdir rootdir && cd rootdir && export ROOTDIR=$PWD
$ apt-get source libdevmapper1.02.1
$ apt-get source cryptsetup
View linux.md

In order (maybe). Some stuff are Arch specific.

Base system stuff

  • grub
  • os-prober

A decent shell and a way to talk to the world

  • zsh
  • grml-zsh-config
  • fish
View gist:5644131

Current situation: A small amount of users annoy the lot of us, we have no power to ban them, mods are annoyed.

Official solution: Go into Gallery mode, so all users can view, only users with explicit write permissions can write. This has the problem of approving users. We don't want to manually approve nearly everyone just to disapprove a small number.

Wayward solution: Use Gallery mode with the bot. When a user enters the room, the bot grants him write access automatically. If the user already has the access, the write access request will just send back a 400 error. No biggie. As it's automatic, the transition is nearly seamless. If a user is banned, the bot won't grant him write access.

View mk_awsm.js
//ths fnctn tks sntnc nd trns t t awsm
//md fr jvscrpt rm
// http://chat.stackoverflow.com/transcript/message/7491494#7491494
var mk_awsm = function(sntnc) {
return sntnc.split(' ').map(function(wrd) {
return 1 >= wrd.length ?
wrd :
2 == wrd.length ?
wrd[0] :
/:.*(.)/.test(wrd) ?
View rl-input.user.js
// ==UserScript==
// @name rlInput box
// @author Robert Lemon
// @version 0.1
// @namespace http://rlemon.com
// @description Produces a small input area for you to execute Javascript on the page. Saves scripts in LocalStorage and executes on page load.
// @include *
// ==/UserScript==
(function () {
@ralt
ralt / jquery-second-click.js
Created Sep 28, 2012 — forked from ryankinal/jquery-second-click.js
jQuery "second click" plugin
View jquery-second-click.js
// Untested, off-the-cuff
$.fn.secondClick = function(handler)
{
if ( !$( this ).data( 'click' ) ) {
$( this ).data( 'click', 1 );
}
else if ( $( this ).data( 'click' ) === 1 ) {
handler();
$( this ).data( 'click', '' );
}
View methods.js
// Assume errorPage, jsonBody, formBody exist within scope.
function methods(routes, handleHttpForms) {
if (handleHttpForms) {
return createHttpFormsRequestHandler(routes)
}
return requestHandler.bind(this)
}
function requestHandler(req, res) {
@ralt
ralt / x.js
Created May 29, 2012 — forked from Raynos/x.js
View x.js
var UserCollection = require("../dataSources/user")
var User = {
find: function( name, skypeName, callback ) {
if ( skypeName ) {
findBySkypeName( name, callback );
}
// The rest of your logic there
}
}
View gist:2769373
module.exports = {
io: null,
socket: null,
createReactiveMethod: function() {},
initialize: function(server) {
console.log("initialized!");
this.io = require('socket.io').listen(server);
var that = this;