This gist is now deprecated in favor of our official documentation: https://documentation.portainer.io/api/api-examples/ which contains up to date examples!
Please refer to the link above to get access to our updated API documentation and examples.
This gist is now deprecated in favor of our official documentation: https://documentation.portainer.io/api/api-examples/ which contains up to date examples!
Please refer to the link above to get access to our updated API documentation and examples.
#!/usr/bin/env python | |
import pynvim, os, re, sys, time | |
# Get a list of buffers that haven't been deleted. `nvim.buffers` includes | |
# buffers that have had `:bdelete` called on them and aren't in the buffer | |
# list, so we have to filter those out. | |
def get_listed_buffers(nvim): | |
return set(buf.number for buf in nvim.buffers \ | |
if nvim.eval('buflisted(%d)' % buf.number)) |
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
}; | |
NodeList.prototype.__proto__ = Array.prototype; |
#!/usr/bin/env ruby | |
# - encoding: utf-8 - | |
# | |
# E.g. with: pinget.rb https://feeds.pinboard.in/rss/secret:YOURSECRET/u:YOURUSERNAME/toread/ | |
require 'rss' | |
require 'open-uri' | |
require 'uri' | |
WGET = ['wget', |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
desc 'rolls back migrations in current branch not present in other' | |
task :rollback_branch_migrations, [:other_branch] do |t, args| | |
load "#{Dir.pwd}/Rakefile" | |
branch_migrations = BranchMigrations.new(args.other_branch) | |
puts ['Rollback the following migrations', branch_migrations, 'y,n? '] | |
next if %w[no n NO N].include?(STDIN.gets.chomp) | |
Rake::Task['environment'].invoke |
fs = require 'fs' | |
path = require 'path' | |
chokidar = require 'chokidar' | |
{spawn} = require 'child_process' | |
DIR = path.join __dirname, 'client' | |
isType = (file, type) -> | |
path.extname(file) is '.' + type |