Skip to content

Instantly share code, notes, and snippets.

import { stringify } from "query-string";
import { fetchUtils } from "ra-core";
const bootDataProvider = (
apiUrl,
httpClient = fetchUtils.fetchJson,
countHeader = "X-Total-Count"
) => ({
getList: (resource, params) => {
const { page, perPage } = params.pagination;
@deluan
deluan / pm-auctions.20s.rb
Created October 25, 2019 14:31
Pulsed Media Auction watcher for BitBar
#!/usr/bin/env ruby
require 'open-uri'
require 'date'
require 'json'
AUCTION_URL="http://pulsedmedia.com/seedbox-auctions.php"
PRODUCT_INFO_URL="http://pulsedmedia.com/clients/widgets/productsinfo.php"
BUY_URL="http://pulsedmedia.com/clients/cart.php?a=add&pid=210&billingcycle=monthly"
@deluan
deluan / alias.sh
Last active June 8, 2019 16:15
My ZSH/Bash custom functions
alias vauth='vault login --method=github'
alias pstree='pstree -g 2'
alias l='ls -lah'
alias la='ls -lAh'
alias ll='ls -lh'
alias ls='ls -G'
alias lsa='ls -lah'
alias grep='grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}'
alias ddc='docker-compose'
@deluan
deluan / crypt.go
Created September 9, 2016 12:33
Testing bcrypt in GoLang
///usr/bin/env go run "$0" "$@"; exit;
package main
import (
"fmt"
"os"
"golang.org/x/crypto/bcrypt"
)
@deluan
deluan / mc.go
Created September 8, 2016 22:08
Test for multiconfig on Go 1.7
///usr/bin/env go run "$0" "$@"; exit;
package main
import "github.com/koding/multiconfig"
type Server struct {
Name string `required:"true"`
Port int `default:"6060"`
Enabled bool
@deluan
deluan / README.md
Last active October 6, 2016 16:33
README for Checkman Simulator

Checkman Simulator

This plugin simulates Checkman functionality, allowing you to use all its plugins and configuring checks in external files. It downloads Checkman's plugins on demand, so you don't need to install Checkman itself.

Available check plugins: HTTP, GoCD, Concourse, Jenkins, Travis, Semaphore, Codeship, CircleCI, Airbrake, GitHub, Pivotal Tracker, TDDium and SnapCI.

To learn more about Checkman and its existing plugins, see:

@deluan
deluan / extract_itunes_artwork.sh
Created March 7, 2016 15:59
Script to transform .itc files into images (JPG or PNG)
#!/bin/bash
# Script to transfort .itc files into images (JPG or PNG)
#
# .itc files are located in ~/Music/iTunes/Album Artwork
#
# This script uses (/!\ needs ) ImageMagick's convert, hexdump, printf and dd.
#
# This script might be a little slow, You might want to look at Simon Kennedy's work at http://www.sffjunkie.co.uk/python-itc.html
AlbumArtwork="${HOME}/Music/iTunes/Album Artwork"
@deluan
deluan / subsonic_upgrade.yml
Last active February 20, 2016 19:42
Upgrade Subsonic on Mac OS X
- hosts: all
gather_facts: no
vars:
- release_tag: "{{latest_release.stdout}}"
- repository: EugeneKay/subsonic
- war_name: subsonic-{{release_tag}}.war
- release_url: https://github.com/{{repository}}/releases/download/{{release_tag}}/{{war_name}}
- app_path: /Applications/Subsonic.app
- war_path: "{{app_path}}/Contents/Resources"
@deluan
deluan / bb-trigger.sh
Created March 8, 2015 05:00
Use this script for services you don't want BB to alert in red on the first failure. It will become yellow first, and then, after a configurable number of polls, it will go red. Useful with network tests over a noisy link (except when you're responsible for the link ;). Tested only with Linux. http://goo.gl/WZFwNZ
#!/bin/sh
#
# $Id: bb-trigger.sh,v 1.2 2002/01/29 18:50:17 deluan Exp $
#
# by Deluan Cotts Quintao ([email protected])
#
# Use this script for services you don't want BB to alert in red on the first error.
# It will become yellow first, and then, after a configurable number of polls, it will
# go red. Useful with network tests over a noisy link (except when you're responsible
# for the link ;)
@deluan
deluan / simian-summary.rb
Last active August 29, 2015 14:09
This script processes the YML output of Simian (http://www.harukizaemon.com/simian/) and generates some useful summarized information
#!/usr/bin/env ruby
require 'yaml'
require 'pp'
if ARGV.count == 0
puts "Usage: simian-sum <simian-result.yml>"
puts
puts "Remember to remove the first 3 lines of the yml file"
exit