Skip to content

Instantly share code, notes, and snippets.

@jig
jig / digits
Created May 17, 2020 14:27
List numbers of 4 and 5 digits that one is the double of the other and all use the 9 digits from 1 to 9 without repiting.
package main
import "fmt"
func main() {
for j := 6234; j < 9876; j++ {
i := 2 * j
if nineChars(i, j) {
fmt.Printf("%d\t%d\n", i, j)
}
@jig
jig / README.md
Last active July 8, 2022 14:09
Delete several items at once on AWS DynamoDB using AWS CLI

You can can use:

aws dynamodb batch-write-item --request-items file:///tmp/deletes.json

where the file /tmp/deletes.json must have this structure like this:

{
for i in `seq 1 100`; do echo $i; docker pull busybox > /dev/null; done;
@jig
jig / gist:bc50ad2d3402ff3efb09
Created February 12, 2016 22:39
Go + Otto minimal sample
package main
import (
"fmt"
"github.com/robertkrimen/otto"
)
func main() {
vm := otto.New()
@jig
jig / client.js
Created November 14, 2012 15:39
dnode chain workers sample
var dnode = require('dnode');
var main = function (remote) {
remote.sumaQuadratica(4, 3, function (res) {
console.log(res);
worker1.end();
}
);
}
@jig
jig / amqprpc.js
Created October 26, 2012 13:48 — forked from kmpm/amqprpc.js
RPC over RabbitMQ/AMQP
var amqp = require('amqp')
, crypto = require('crypto')
var TIMEOUT=2000; //time to wait for response in ms
var CONTENT_TYPE='application/json';
var CONTENT_ENCODING='utf-8';
exports = module.exports = AmqpRpc;
function AmqpRpc(connection){