Skip to content

Instantly share code, notes, and snippets.

@lantto
lantto / create_failed_jobs_table.php
Last active October 14, 2016 13:03
Create failed jobs table migration (Laravel/Lumen)
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
@lantto
lantto / autoupvote.js
Last active April 9, 2017 04:51
Automatically upvote after X minutes
function setTitle(voteAt, minutesAgo, originalTitle) {
var voteIn = voteAt - minutesAgo;
var unit = (voteIn === 1 ? 'minute' : 'minutes');
var newTitle = '<Votes in ' + voteIn + ' ' + unit + '> | ' + originalTitle;
if (document.title !== newTitle) {
document.title = newTitle;
}
@lantto
lantto / donate.js
Last active August 14, 2016 10:56
Donate Directly
var waitForAndExecute = function(waitForFun, execFun) {
(function() {
function waitForAndExecute(waitForFun, execFun) {
if (!waitForFun()) {
setTimeout(function() {
waitForAndExecute(waitForFun, execFun);
}, 100);
return;
}
@lantto
lantto / ssp.js
Last active August 14, 2016 10:54
Show Steem Power
var isVisible = function(obj) {
return obj.offsetWidth > 0 && obj.offsetHeight > 0;
};
var curry = function(uncurried) {
var parameters = Array.prototype.slice.call(arguments, 1);
return function() {
return uncurried.apply(this, parameters.concat(Array.prototype.slice.call(arguments, 0)));
};