Skip to content

Instantly share code, notes, and snippets.

0xdEd06033526BA77D5eDBBaab141D2ab4bb0e1409
@krogla
krogla / QueueRetryAllCommand.php
Created November 14, 2017 13:01 — forked from JacobBennett/QueueRetryAllCommand.php
Laravel Queue:Retry-Multiple and Queue:Retry-All
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class RetryAllCommand extends Command
{
/**
* The name and signature of the console command.
//Remove contracts by ID
CustomContracts.find().fetch();
CustomContracts.remove("_CONTRACT_ID_");
//Remove tokens by ID
Tokens.find().fetch();
Tokens.remove("_TOKEN_ID_");
//Remove all contracts
CustomContracts.find().fetch().map(
@krogla
krogla / remove.js
Last active March 7, 2018 10:43
remove unused contracts from Mist
//rename unused contracts to '--' and run script
CustomContracts.find().fetch().map(
function(m) { if (m.name == '--') {CustomContracts.remove(m._id);}}
)
@krogla
krogla / client.js
Created October 4, 2019 19:27 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@krogla
krogla / index.ts
Created April 29, 2020 15:12 — forked from Curtis017/index.ts
Simple middleware implementation using typescript and ES6
import pipeline, { Middleware } from './pipeline';
const step1: Middleware<any, any> = (req, res, next) => {
if (req.body) {
console.log(`STEP 1: \n req: ${JSON.stringify(req)}\n res: ${JSON.stringify(res)}`);
next();
}
}
const step2: Middleware<any, any> = async (req, res, next) => {
@krogla
krogla / MiddlewareES6.js
Created April 29, 2020 15:12 — forked from sylvainleris/MiddlewareES6.js
A very minimal Javascript (ES5 & ES6) Middleware Pattern Implementation
class Middleware {
constructor() {
// Array prototype last
if (!Array.prototype.last) {
Array.prototype.last = function() {
return this[this.length - 1];
}
}
const { create, globSource } = require('ipfs-http-client')
const globSourceOptions = {
recursive: true
}
const addOptions = {
pin: true,
wrapWithDirectory: true,
timeout: 10000
@krogla
krogla / parallels-reset.sh
Created June 10, 2022 08:11 — forked from gdurastanti/parallels-reset.sh
Reset Parallels' trial
#!/bin/sh
# Reset Parallels Desktop's trial and generate a casual email address to register a new user
rm /private/var/root/Library/Preferences/com.parallels.desktop.plist /Library/Preferences/Parallels/licenses.xml
jot -w pdu%d@gmail.com -r 1
const connectToKeplr = async (): Promise<any> => {
if (window.keplr) {
window.keplr
.experimentalSuggestChain({
// Chain-id of the Regen chain.
chainId,
// The name of the chain to be displayed to the user.
chainName: 'Regen Devnet',
// RPC endpoint of the chain.
rpc: 'http://devnet.regen.network:26657',