Skip to content

Instantly share code, notes, and snippets.

View gist:8848959
{
"query":{
"function_score":{
"query":{
"bool":{
"should":[
{
"bool":{
"must":[
{
View .vimrc
function! ExecuteMapping()
if exists("g:mapping")
execute :wa
execute "!" . g:mapping
endif
endfunction
function! SetupMapping()
let g:mapping = input('Command: ')
endfunction
View launch
#!/bin/bash -e
go get
go build
sudo service nginx start
prodotti_servers=`pgrep -f "prodotti server"`
if [ "$(curl -fsS localhost:9091)" == 'prodotti' ]; then
View .vimrc
" mappings {{{
function! SetupMapping()
let g:mapping = input('Command: ')
endfunction
function! ExecuteMapping()
if exists("g:mapping")
execute :wa
execute "!" . g:mapping
endif
endfunction
View gist:9082378
export ETCD_DISCOVERY_URL=https://gist.github.com/AndrewVos/RANDOM
systemctl start fleet
View gist:9082226
-ETCD_DISCOVERY_URL=https://discovery.etcd.io/3eea1dc4f17a141122e6098354c0b166
-START_FLEET=1
+export ETCD_DISCOVERY_URL=https://gist.github.com/AndrewVos/<RANDOM>
View config
set $mod Mod4
focus_follows_mouse no
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
# bindsym $mod+Return exec /usr/bin/rxvt
View volume
#!/usr/bin/env ruby
MIN = 0
MAX = 65536
SINK = `pactl stat |grep "Default Sink: "`.split(" ")[2]
STEP = MAX / 16
volume = `pacmd dump | grep "set-sink-volume #{SINK}"`.split(" ")[2].to_i(16)
muted =`pacmd dump | grep "set-sink-mute #{SINK}"`.split(" ")[2] == "yes"
View server.go
func pathExists(path string) bool {
_, err := os.Stat(path)
if err == nil {
return true
}
return false
}
View launch-elasticsearch
if [ -n "$AWS_ACCESS_KEY" && -n "$AWS_SECRET_KEY" ]; then
echo cloud.aws.access_key: $AWS_ACCESS_KEY >> $YML
echo cloud.aws.secret_key: $AWS_SECRET_KEY >> $YML
if [ -n "$AWS_REGION" ]; then
echo cloud.aws.region: $AWS_REGION >> $YML
fi
echo discovery.type: ec2 >> $YML
fi
You can’t perform that action at this time.