Skip to content

Instantly share code, notes, and snippets.

@kikiyou
kikiyou / aes.go
Created November 28, 2018 07:39
AES example using web crypto
/*
To double check aes.js, I wrote the same thing in go.
Because of standards, we should be able to encrypt in js
and decrypt in go. Seems to work fine, with some odd padding.
*/
package main
import (
"crypto/aes"
@kikiyou
kikiyou / server.go
Created October 17, 2018 12:31 — forked from soheilhy/server.go
grpc route guide server + cmux
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
@kikiyou
kikiyou / threadqueue_example.py
Created April 19, 2018 06:11 — forked from initbrain/threadqueue_example.py
Python thread-safe queue example
#!/usr/bin/env python
from Queue import Queue
from threading import Thread
from urllib2 import urlopen
from re import compile, MULTILINE
from time import time
class ThreadUrl(Thread):
@kikiyou
kikiyou / impl.go
Created December 18, 2017 01:27
alertmananger 使用微信图文告警,代码片段
// Copyright 2015 Prometheus Team
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.