Skip to content

Instantly share code, notes, and snippets.

View replsv's full-sized avatar

Gabriel C. replsv

View GitHub Profile
@replsv
replsv / config.rasi
Created October 31, 2020 10:54
rofi config
configuration {
modi: "window,run,ssh,drun";
show-icons: true;
font: "Inconsolata 10, Fira Code 10";
icon-theme: "Papirus-Dark";
}
// theme
* {
#!/usr/bin/env bash
#
# Parses DHCP options from openvpn to update resolv.conf
# To use set as 'up' and 'down' script in your openvpn *.conf:
# up /etc/openvpn/update-resolv-conf
# down /etc/openvpn/update-resolv-conf
#
# Used snippets of resolvconf script by Thomas Hood <jdthood@yahoo.co.uk>
# and Chris Hanson
# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL.
@replsv
replsv / nvim.init
Last active February 26, 2020 19:10
nvim-config
call plug#begin('~/.config/nvim/.plugged')
" operators
Plug 'tpope/vim-surround'
Plug 'christoomey/vim-sort-motion'
" textobj
Plug 'wellle/targets.vim'
" workflow
@replsv
replsv / .bashrc
Created February 19, 2020 09:36
starship config
# ~/.bashrc
eval "$(starship init bash)"
@replsv
replsv / java
Created May 28, 2019 06:39
RN_Synchronized_UIImplementation
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.uimanager;
import static android.view.View.MeasureSpec.AT_MOST;
import static android.view.View.MeasureSpec.EXACTLY;
@replsv
replsv / slack-push-logs.sh
Created April 7, 2017 20:27
Slack log file watcher
#!/bin/bash
SLACK_HOOK_URL="https://hooks.slack.com/services/SOME/SPECIAL/TOKEN"
SLACK_CHANNEL="#production-logs"
tail -n0 -F "$1" | while read LINE; do
(echo "$LINE") && curl -X POST --silent --data-urlencode \
"payload={\"channel\": \"$SLACK_CHANNEL\", \"mrkdwn\": true, \"text\": \"$(echo $LINE | sed "s/\"/'/g") | File: ${1} | Server: $(hostname)\"}" $SLACK_HOOK_URL;
done
<?php
/**
composer.json
{
"name": "predis-copy-keys",
"require": {
"predis/predis": "^1.1"
},
"authors": [
#!/bin/bash
# git-mv-with-history -- move/rename file or folder, with history.
# https://git.wiki.kernel.org/index.php/GitFaq#Why_does_Git_not_.22track.22_renames.3F
function usage() {
echo "How to use it: `basename $0` [-d/--dry-run] [-v/--verbose] <srcname>=<destname> <...> <...>"
[ -z "$1" ] || echo $1
exit 1
}
#!/bin/bash
# es-maintenance-script.sh
# Notes:
# - https://www.elastic.co/guide/en/elasticsearch/guide/current/retiring-data.html
# - http://tech.superhappykittymeow.com/?p=296
#
# Author: Gabriel C <shellcooking@gmail.com>
# Display instructions
help()
#!/bin/bash
while [[ $# > 1 ]]
do
key="$1"
case $key in
-i|--initial)
INITIAL_COMMIT="$2"
shift # past argument