Skip to content

Instantly share code, notes, and snippets.

View shahinism's full-sized avatar
🌱
Shahining

Reza Khanipour shahinism

🌱
Shahining
View GitHub Profile
@shahinism
shahinism / slack-auto-dir.user.js
Last active August 26, 2018 15:23
Slack Bidirectional Text (Add RTL support to slack)
// ==UserScript==
// @name Slack Bidirectional Text (Add RTL support to slack)
// @namespace http://bit.ly/2kHm59H
// @version 1.0
// @description Set auto direction for all message boxes
// @author Shahin
// @include https://*.slack.com/*
// @grant none
// ==/UserScript==
(function() {
@shahinism
shahinism / standard-es6-express.sh
Created January 5, 2017 09:27
Transform express-generator generated project to ES6 syntax with Standard lint
#!/bin/bash
# Description:
# After generating project using express-generator, you can use
# this script to transform codes to ES6 syntax and standard lint
# friendly base.
#
# Requirements:
# You need following packages for this script to work:
# - express-generator
# - lebab
@shahinism
shahinism / openconnect_client_on_mac.sh
Created November 23, 2016 13:20
Install openconnect client on macos
#!/bin/bash
find_or_install() {
# Check if brew package $1 is installed
# http://stackoverflow.com/a/20802425/1573477
if brew ls --versions $1 > /dev/null; then
echo "Installing ${1}"
brew install $1
else
echo "${1} is already installed."
@shahinism
shahinism / insplash.sh
Last active November 11, 2016 19:40
Download unsplash.com collections
#!/bin/bash
# USAGE:
# Download insplash.sh
# chmod +x instplash.sh
# ./insplash.sh COLLECTION_URL
# ./insplash.sh https://unsplash.com/collections/279087/weather-and-sky
PATTERN='http:\/\/unsplash.com\/photos\/[[:alnum:]]*\/download'
COUNT=1
curl -s $1 | grep -o $PATTERN | while read -r LINK; do
aria2c -x16 -o "image.${COUNT}.jpeg" $LINK
@shahinism
shahinism / Dracula.colorscheme
Last active October 28, 2016 09:16
KDE Konsole Dracula Theme
[Background]
Color=40,42,54
[BackgroundFaint]
Color=40,40,40
[BackgroundIntense]
Color=40,40,40
[Color0]
@shahinism
shahinism / .conkyrc
Created August 15, 2016 07:19
My conkyrc
-- vim: ts=4 sw=4 noet ai cindent syntax=lua
conky.config = {
------------------------------
-- Generic
------------------------------
background = true,
update_interval = 1,
double_buffer = true,

Keybase proof

I hereby claim:

  • I am shahinism on github.
  • I am shahinism (https://keybase.io/shahinism) on keybase.
  • I have a public key ASA3hKKoVgWQkZF3Vcdx7BEicBdNus57GHKa0GM34xIw_wo

To claim this, I am signing this object:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shahinism
shahinism / ocserver_install.sh
Last active June 22, 2021 08:13
How to install ocserv (OpenConnect server, aka: free version of Cisco's Anyconnect) on Ubuntu 16.04
echo "This gist have not to be executed directly"
exit 0
# Edit `/etc/default/ufw` and set:
# DEFAULT_FORWARD_POLICY="ACCEPT"
# The restart ufw
systemctl restart ufw
# Install ufw from command line
apt install ocserv
@shahinism
shahinism / shahin.zsh-theme.sh
Last active August 29, 2015 14:05
My zsh prompt theme. Inspired by themes that oh-my-zsh carry on.
# Determine the time since last commit. If branch is clean,
# use a neutral color, otherwise colors will vary according to time.
function git_time_since_commit() {
if git rev-parse --git-dir > /dev/null 2>&1; then
# Only proceed if there is actually a commit.
if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then
# Get the last commit.
last_commit=`git log --pretty=format:'%at' -1 2> /dev/null`
now=`date +%s`
seconds_since_last_commit=$((now-last_commit))