This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Api::Validators | |
class ContractValidator | |
include Hanami::Validations | |
namespace :contract | |
validations do | |
required(:vendor) { type?(String) & filled? } | |
required(:starts_on) { type?(String) & filled? } | |
required(:ends_on) { type?(String) & filled? } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
db=$1 | |
table=$2 | |
if [[ $# -eq 0 ]] || [[ "$1" == "--help" ]]; then | |
echo "Usage: $0 db [table]" | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chromium 94.08% 7344.44 MB | |
mysqld 2.36% 183.99 MB | |
mongod 1.77% 137.82 MB | |
dwb 1.00% 78.28 MB | |
urxvt 0.81% 63.51 MB | |
syncthing 0.69% 53.62 MB | |
Xorg 0.64% 49.71 MB | |
panel.sh 0.51% 39.65 MB | |
gvim 0.47% 36.96 MB | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vim-airline: (5.145ms) ************************************************************************************************************************ | |
vim-fugitive: (4.951ms) ******************************************************************************************************************* | |
unimpaired: (3.21 ms) ************************************************************************** | |
UltiSnips: (2.234ms) **************************************************** | |
vim-ruby-refactoring: (1.932ms) ********************************************* | |
bufkill: (1.437ms) ********************************* | |
tagbar: (1.184ms) *************************** | |
vim-rake: (1.115ms) ************************** | |
ctrlp: (1.099ms) ************************* | |
vim-rails: (0.969ms) ********************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
DEVICE=$1 | |
SYMLINK=$2 | |
TMPDIR=$(mktemp -d) | |
MAPPER=/dev/mapper/$SYMLINK | |
PARTITION=${DEVICE}1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function mute() { | |
current_vol=$(get) | |
# turn vol down | |
for (( i = $current_vol; i >= 0; i-=2 )); do | |
amixer -q set Master $i% | |
sleep 0.01 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'uri' | |
require "readline" | |
require 'optparse' | |
STORE_DIR = ENV['PASSWORD_STORE_DIR'] || File.join(ENV['HOME'], '.password-store') | |
CLIP_TIME = ENV['PASSWORD_STORE_CLIP_TIME'] || 45 | |
OPTIONS = {clip: true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DEVICE="sda" | |
BOOT_PARTITION="sda1" | |
hostname=$(hostname) | |
dd if=/dev/${BOOT_PARTITION} of=/backup/${hostname}_${BOOT_PARTITION}_boot-partition.img bs=512 count=2048 >/dev/null | |
dd if=/dev/${DEVICE} of=/backup/${hostname}_${DEVICE}_mbr.img bs=512 count=2048 >/dev/null | |
sfdisk -d /dev/${DEVICE} > /backup/${hostname}_${DEVICE}_partitiontable.txt | |
pacman -Qqen > /backup/${hostname}_pacman.txt | |
pacman -Qqem > /backup/${hostname}_aur.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download database of installed android application via ADB. | |
set -e | |
package=$1 | |
if [[ $# -eq 1 ]]; then | |
adb -d shell "run-as $package ls /data/data/$package/databases/*.db" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $1 == '--help' ]] || [[ $1 == '-h' ]] || [[ $# -le 1 ]]; then | |
echo "Usage: $(basename $0) input.mp4... output.mp4" | |
exit 1 | |
fi | |
pwd=$(pwd) | |
temp=$(mktemp) |
NewerOlder