Skip to content

Instantly share code, notes, and snippets.

  • le.doot.generation: !
  • zewl.bot: .
  • chester.bot.doot.doot: $
  • steveice (interim): %
  • spongybot: #
  • totallynotfabbot: -
  • rob.the.bot: ?
  • wee.bot: `
  • hintss.bot: lol
@dandirks
dandirks / gist:05a6e2d22d38349263ed
Created March 7, 2015 21:05
Straw Poll - New Poll API
Make a POST with something like the following body to "http://strawpoll.me/api/v2/polls"
{
"title": "Poll title",
"options":[
"Option #1",
"Option #2",
"Option #3"
],
"multi": true,
anonymous
anonymous / abyss-as-a-service
Created November 20, 2015 14:56
Floating serenely through a peaceful abyss, a sigh escapes; content.
A siren wails, you're jolted from your respite
/dev/xsdb1 is at 100%
A cacophony of alerts screech from the phone.
Upset is the fragile balance, failure cascades.
Was only a matter of time.
Get some coffee.
All you ping seems to crumble, machine after machine fall; a massacre of uptime.
@aadnk
aadnk / AnvilListener.java
Created April 13, 2014 00:44
Detect when anvils are broken by overuse.
package com.comphenix.example;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
anonymous
anonymous / night-before-opsmas.txt
Created December 24, 2013 07:19
Twas the night before Opsmas..
'Twas the night before Christmas, when all through the racks
Not a server was alerting, not even Compaqs.
The backups were written to tapes with care
In hopes that later the data would be there.
The machines were nestled all snug in their sleds
Whilst visions of vengeance danced in their heads;
And oncall in his three-wolf and I in my rack.
Had just settled down for some syn and some ack.
@candlewill
candlewill / keras_models.md
Last active December 9, 2022 02:43
A collection of Various Keras Models Examples

Keras Models Examples

一系列常用模型的Keras实现

DNN

Multilayer Perceptron (MLP) for multi-class softmax classification

from keras.models import Sequential
@Koboo
Koboo / BsonToBinary.java
Last active February 15, 2023 19:01
Just a static utility class to convert BSON Documents to byte-array and vice versa
import org.bson.BsonBinaryReader;
import org.bson.BsonBinaryWriter;
import org.bson.Document;
import org.bson.codecs.Codec;
import org.bson.codecs.DecoderContext;
import org.bson.codecs.DocumentCodec;
import org.bson.codecs.EncoderContext;
import org.bson.io.BasicOutputBuffer;
import java.nio.ByteBuffer;
# Docker networking is messy and undocumented. Docker will create IP addresses and iptables at random times.
# This can be limited by using totally static IP addresses for network interfaces and avoiding the default network bridge.
# /etc/default/docker
# DOCKER_OPTS="--iptables=false --ipv6 --bip 172.16.0.1/16 --fixed-cidr 172.16.0.0/16 --fixed-cidr-v6 2a01:9000::/68"
# --bip is the host IP address of the docker0 interface
# --fixed-cidr is the CIDR subnet allocated to the docker0 interface (default network bridge)
# --fixed-cidr-v6 is the IPv6 CIDR allocated to docker0
# for IPv6 split your /64 delegated subnet into /68 subnets and allocate them to each docker-compose.yml subnet:
@trodrigues
trodrigues / gist:1023167
Created June 13, 2011 16:51
Checkout only certain branches with git-svn
If you want to clone an svn repository with git-svn but don't want it to push all the existing branches, here's what you should do.
* Clone with git-svn using the -T parameter to define your trunk path inside the svnrepo, at the same time instructing it to clone only the trunk:
git svn clone -T trunk http://example.com/PROJECT
* If instead of cloning trunk you just want to clone a certain branch, do the same thing but change the path given to -T:
git svn clone -T branches/somefeature http://example.com/PROJECT
@atenni
atenni / README.md
Last active April 24, 2024 01:36
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]