This file contains hidden or 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
data:text/csv;base64,MSxhbGEsbWEsa290YQ== |
This file contains hidden or 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
if request.path == "/reload" | |
self.class.load_settings! | |
RailsMultisite::ConnectionManagement.each_connection { SiteSetting.refresh! } | |
return [200, {}, ["success"]] | |
end |
This file contains hidden or 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 | |
while true; do | |
DEVICE=$(scanimage -f "%d%n" | grep epjitsu) | |
mkdir -p /tmp/scanner | |
rm /tmp/scanner/out*.pnm 2> /dev/null | |
TIMESTAMP=$(date +%Y%m%d%H%M%S) | |
scanimage -d $DEVICE --mode Lineart --resolution 300 --source "ADF Duplex" --batch=/tmp/scanner/out%03d.pnm 2> /dev/null | |
if [ -f /tmp/scanner/out001.pnm ]; then | |
for file in /tmp/scanner/out*.pnm; do |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require "csv" | |
time = 0 | |
CSV.foreach(ARGV.first, headers: true) do |row| | |
puts "#{row["Start date"]} #{row["Duration"]} #{row["Description"]}" | |
hours, minutes, seconds = row["Duration"].split(":").map(&:to_i) | |
time += hours * 3600 + minutes * 60 + seconds |
This file contains hidden or 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 Trello ID | |
// @author Jakub Kuźma | |
// @version 0.1.1 | |
// @description Displays IDs on the cards | |
// @include https://trello.com/* | |
// ==/UserScript== | |
var main = function () { | |
setInterval(function () { |
This file contains hidden or 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 | |
DEVICE=$(scanimage -f "%d%n" | grep epjitsu) | |
while true; do | |
rm out*.pnm 2> /dev/null | |
TIMESTAMP=$(date +%Y%m%d%H%M%S) | |
scanimage -d $DEVICE --mode Lineart --resolution 300 --source "ADF Duplex" -b 2> /dev/null | |
if [ -f out1.pnm ]; then | |
for file in out*.pnm; do |
This file contains hidden or 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
require "socket" | |
loop do | |
begin | |
socket = TCPSocket.new("localhost", 6600) | |
time = nil | |
loop do | |
socket.puts "status" |
This file contains hidden or 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
var rbind = function (context) { | |
var fn = this, | |
slice = Array.prototype.slice, | |
xargs = slice.call(arguments, 1); | |
return function () { | |
var args = slice.call(arguments).concat(xargs); | |
return fn.apply(context || fn, args); | |
}; | |
}; |
This file contains hidden or 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
var waitForError = function (expectedError, done) { | |
var originalExceptionListener = process.listeners("uncaughtException").pop(); | |
process.once("uncaughtException", function (error) { | |
process.listeners("uncaughtException").push(originalExceptionListener); | |
if (error instanceof expectedError) { | |
done(); | |
} else { | |
process.nextTick(function () { |
This file contains hidden or 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
// state = { | |
// deal: { | |
// n: ["HA", "..."], | |
// e: ["DA", "..."], | |
// s: ["SA", "..."], | |
// w: ["CA", "..."] | |
// }, | |
// vulnerability: "BOTH", | |
// dealer: "E", | |
// bids: ["PASS", "1C", "X", "..."], |