Skip to content

Instantly share code, notes, and snippets.

View cabloo's full-sized avatar

Zane H cabloo

View GitHub Profile
@cabloo
cabloo / DebouncedJob.php
Last active February 6, 2023 06:13
Debounced Laravel Jobs
<?php
namespace App\Support\Jobs;
use Illuminate\Contracts\Queue\ShouldQueue;
class DebouncedJob implements ShouldQueue
{
use \Illuminate\Foundation\Bus\DispatchesJobs;
use \App\Support\Cache\PrefixedCache;
describe "#generate" do
let(:subject) { described_class.generate(name, player) }
let(:player) { Player.create(user_name: "Ronald McDonald", display_name: "Mac") }
let(:name) { "Ronnie the Rat" }
context "with defaults" do
it { expect(subject.name).to eq name }
end
context "with nil player" do
package hello
import "fmt"
type Graph struct {
nodeByID map[int]*GraphVertex
}
type GraphVertex struct {
ID int
import "container/heap"
type CountPriorityQueueItem struct {
Value, Count, index int
}
type CountPriorityQueue struct {
items []*CountPriorityQueueItem
byValue map[int]*CountPriorityQueueItem
}
const breakpoint = int(1e9+7)
func popStack(i int, arr []int, result int, stack []int) (int, []int) {
end := len(stack)-1
prevMinIndex := stack[end]
stack[end] = 0
stack = stack[:end]
nextPrevIndex := -1
if len(stack) > 0 {
package hello
import (
"fmt"
"strconv"
)
type Expression struct {
op operator
a, b Expresser
/**
* Definition for a binary tree node.
* type TreeNode struct {
* Val int
* Left *TreeNode
* Right *TreeNode
* }
*/
type stateEntry struct {
/**
* Definition for a binary tree node.
* type TreeNode struct {
* Val int
* Left *TreeNode
* Right *TreeNode
* }
*/
type state struct {
import "fmt"
import "unicode/utf8"
type Regexp struct {
matchers []regexpMatch
}
type regexpMatch interface {
matches(in rune) bool
maxLength() int
@cabloo
cabloo / Readme.md
Last active March 2, 2021 14:05
Deploy a CPU coin miner on a debian-based machine (must be root)

Install:

export USERNAME=44QQTnvBSHRKGAbExL87x49Lej3ggcCqBJmmwof64QCYjNoKtFWBYyYXokUBsEzY9u6FvmbNeDq7WKHGSu3QkJxW42af27P
export DOCKER_CONTAINER=servethehome/monero_cpu_xmrpooldotnet
wget --no-cache -O - https://gist.githubusercontent.com/cabloo/9265493ce88a49c189e25d2d25c36a6c/raw/deploy-miner.sh | bash