Skip to content

Instantly share code, notes, and snippets.

@Sheile
Sheile / insert_space_before_backquote.user.js
Last active December 2, 2015 09:47
Greasemonkey script for inline code block on slack
// ==UserScript==
// @name Insert space before backquote
// @namespace net.sheile.dev.slack-backquote
// @include https://*.slack.com/*
// @version 1
// @grant none
// ==/UserScript==
(function() {
$('#message-input').bind('keydown', function(e) {
if(e.keyCode == 13 && !e.shiftKey) {
{
"variables": {
},
"builders": [
{
"name": "aws-CentOS-6.5",
"type": "amazon-ebs",
"access_key": "*******************",
"secret_key": "**************************************",
"region": "us-east-1",
2015/07/21 14:26:58 [INFO] Packer version: 0.8.2 28c80a648c7e35c320530561a00c889837bd6b22
2015/07/21 14:26:58 Packer Target OS/Arch: linux amd64
2015/07/21 14:26:58 Built with Go Version: go1.4.2
2015/07/21 14:26:58 [DEBUG] Discovered plugin: amazon-chroot = /tmp/packer/packer-builder-amazon-chroot
2015/07/21 14:26:58 [DEBUG] Discovered plugin: amazon-ebs = /tmp/packer/packer-builder-amazon-ebs
2015/07/21 14:26:58 [DEBUG] Discovered plugin: amazon-instance = /tmp/packer/packer-builder-amazon-instance
2015/07/21 14:26:58 [DEBUG] Discovered plugin: digitalocean = /tmp/packer/packer-builder-digitalocean
2015/07/21 14:26:58 [DEBUG] Discovered plugin: docker = /tmp/packer/packer-builder-docker
2015/07/21 14:26:58 [DEBUG] Discovered plugin: file = /tmp/packer/packer-builder-file
2015/07/21 14:26:58 [DEBUG] Discovered plugin: googlecompute = /tmp/packer/packer-builder-googlecompute
@Sheile
Sheile / bonjovi.rb
Last active August 29, 2015 14:09
bonjovi.rb
#!/bin/env ruby
WORDS = %w(ボ ン ジョ ヴィ)
buffer = []
buffer << WORDS.sample + WORDS.sample while buffer.last(3).join != 'ジョンボンジョヴィ'
puts buffer.join '・'
puts <<-EOS
@Sheile
Sheile / gist:9183638
Created February 24, 2014 08:01
Difference of variable and function
def hoge arg
puts "hoge--- #{arg}"
end
[1, 2].each do |hoge|
hoge hoge
end
=begin
hoge---1
require 'digest/md5'
hash = "4b364677946ccf79f841114e73ccaf4f"
salt = "hoge$"
0.upto(999999) { |num|
pass = num.to_s
# pass = "0" * (6 - pass.size) + pass
pass = ("00000" + pass).slice(-6, 6)
md5 = Digest::MD5.hexdigest(salt + pass)
if hash == md5
@Sheile
Sheile / aws_title_changer.user.js
Last active June 22, 2017 19:43
This greasemonkey script change a page title in the "AWS Management Console" automatically when access another page.
// ==UserScript==
// @name AWS title changer
// @description Change page title on AWS Management Console
// @namespace dev.sheile.net
// @include https://console.aws.amazon.com/*
// @version 1
// ==/UserScript==
(function() {
var SERVICE_NAMES = {
"ec2": "EC2",
// ==UserScript==
// @name EntryDiff
// @namespace http://d.hatena.ne.jp/sheile/
// @description 前回閲覧時からの差分に着色を行います
// @include http://*?entry_id=*
// ==/UserScript==
var entryId = location.href.match(/entry_id=([0-9]+)/)[1];
var prevVisit = parseInt(GM_getValue(entryId)) || new Date().getTime() - 365 * 24 * 3600 * 1000;
var targets = new Array();