Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Snippet development
Quickly finding snippets
There are some ways you can quickly find a snippet file:
*
M-x yas/new-snippet
Prompts you for a snippet name, then tries to guess a suitable directory to store it, prompting you for creation if it does not exist. Finally, places you in a new buffer set to snippet-mode so you can write your snippet.
@kazu634
kazu634 / test.geojson
Created May 15, 2019 15:51
テスト用のGeojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kazu634
kazu634 / ec2-list.rb
Created November 29, 2016 09:16
AWS CLI related scripts
#!/usr/bin/env ruby
instances = `aws ec2 describe-instances | \
jq -r -c '.Reservations[].Instances[] | [.InstanceId, (.Tags[]? | select(.Key == "Name")).Value, .PrivateIpAddress , .State.Name ] | @csv'`
instances.split().each do |instance|
id, name, ip, state = instance.gsub('"', '').split(',')
name = "NONAME" if name.empty?
puts "#{name}\t#{id}\t#{ip}\t#{state}"
@kazu634
kazu634 / test.conf
Created March 1, 2016 13:38
Test configuration file for td-agent
<source>
type dstat
tag foo
option -cdnm --tcp --udp --load -gs
delay 5
</source>
<source>
type df
option -k
#!/opt/td-agent/embedded/bin/ruby
require 'growthforecast'
COLOR_CPU = {
'hiq' => '#77cc11',
'idl' => '#77cccc',
'siq' => '#77cc11',
'sys' => '#cc7711',
'usr' => '#cc77cc',
@kazu634
kazu634 / default
Created January 9, 2016 15:17
nginx configuration for HTTP/2
server {
# allow access from localhost
# listen 80 reuseport backlog=1024;
listen 443 ssl http2 backlog=1024;
server_name test.kazu634.com;
ssl_certificate /etc/letsencrypt/live/test.kazu634.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/test.kazu634.com/privkey.pem;
ssl_dhparam /etc/letsencrypt/live/test.kazu634.com/dhparams_4096.pem;
@kazu634
kazu634 / pre-push
Created January 5, 2014 11:48
Gitのpre-push hook用スクリプト。git-nowコマンドと一緒に使うことを想定しています。
#!/bin/sh
z40=0000000000000000000000000000000000000000
IFS=' '
while read local_ref local_sha remote_ref remote_sha
do
if [ "$local_sha" = $z40 ]
then
# Handle delete
# SERVERSPEC - Resource Types | http://serverspec.org/resource_types.html
#=============================
# command
#=============================
snippet desco
alias descom
abbr describe command('whoami') do ~ end
prev_word '^'
describe command('${1:whoami}') do
${0}