Skip to content

Instantly share code, notes, and snippets.

Alisina Bahadori alisinabh

Block or report user

Report or block alisinabh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alisinabh
alisinabh / Dockerfile
Created Aug 12, 2019
Stolon postgis postgresql
View Dockerfile
# Source image of stolon to add postgis to
FROM sorintlab/stolon:v0.13.0-pg10
# Since we are using a pg10 image of stolon we will install postgresql-10-postgis-x.x
RUN apt-get update && apt-get install -y postgresql-10-postgis-2.4
@alisinabh
alisinabh / decrease-brightness.sh
Created Apr 21, 2017
X window selective brightness control - using Xrandr and awk
View decrease-brightness.sh
BRIGHTNESS=`xrandr --verbose | grep -i brightness | cut -f2 -d ' ' | head -n1`
NEW_BRIGHTNESS=`awk '{print $1-$2}' <<<"$BRIGHTNESS 0.05"`
echo $NEW_BRIGHTNESS
xrandr --output DVI-I-1 --brightness $NEW_BRIGHTNESS
xrandr --output DVI-I-2 --brightness $NEW_BRIGHTNESS
@alisinabh
alisinabh / opposite_math_macro.exs
Last active Dec 16, 2016
Creating a macro with elixir to vice versa nested math operations
View opposite_math_macro.exs
defmodule OppositeMath do
@moduledoc """
This module helps with oppositting nested math formuals like 2 + 5 * 4 + 6 => 2 - 5 / 4 - 6 for sake of learning elixir macros
"""
@doc """
This macro opposites all math symbols in a formula
## Examples
iex> OppositeMath.opposite 1+1
@alisinabh
alisinabh / bitconverter_sample.ex
Last active Dec 11, 2016
Elixir convert binary (byte array) to signed Int32 with pattern matching and vice versa [DEPRECARED - just use whats inside the functions]
View bitconverter_sample.ex
defmodule ZigorProxy.BitConverter do
@moduledoc """
This module handles standard binary operations.
Converting binaries to and from general data types.
"""
require Logger
@doc """
Converts binary of 4 bytes into an signed integer.
You can’t perform that action at this time.