Skip to content

Instantly share code, notes, and snippets.

View ZoomQuiet's full-sized avatar
🖖
Sayeahooo

Zoom.Quiet ZoomQuiet

🖖
Sayeahooo
View GitHub Profile
@ZoomQuiet
ZoomQuiet / Dockerfile
Created November 26, 2020 06:27 — forked from wemgl/Dockerfile
Elixir Umbrella App Dockerfile
FROM elixir:1.11.1-alpine AS build
# install build dependencies
RUN apk add --no-cache build-base npm git
# prepare build dir
WORKDIR /app
# install hex + rebar
RUN mix local.hex --force && \
@ZoomQuiet
ZoomQuiet / ElixirLinkedList.ex
Created October 20, 2020 08:07 — forked from aaruel/ElixirLinkedList.ex
Elixir Linked List Implementation
defmodule LinkedList do
defstruct data: 0,
next: nil,
index: 0
def new(data \\ 0, index \\ 0) do
%__MODULE__{data: data, index: index}
end
def push(
@ZoomQuiet
ZoomQuiet / donotuse3.py
Created September 24, 2020 02:04 — forked from MineRobber9000/donotuse3.py
How to NEVER use lambdas - Python 3 edition
###########################################################
# How to NEVER use lambdas. An inneficient and yet educa- #
# tonal [sic] guide to the proper misuse of the lambda #
# construct in Python 3.x. [DO NOT USE ANY OF THIS EVER] #
# original by (and apologies to): e000 (13/6/11) #
# now in Python 3 courtesy of: khuxkm (17/9/20) #
###########################################################
## Part 1. Basic LAMBDA Introduction ##
# If you're reading this, you've probably already read e000's
@ZoomQuiet
ZoomQuiet / install.md
Created April 1, 2019 03:50 — forked from bitjockey42/install.md
Install SIP and PyQT4 (pyenv, pyenv-virtualenv)

Download

pyenv virtualenv

Switch to the Python version you want to use:

@ZoomQuiet
ZoomQuiet / replace_parameters.py
Created March 30, 2019 02:21 — forked from kchawla-pi/replace_parameters.py
A python decorator for deprecating parameters from a function/method
"""
Gist made by Kshitij Chawla (Github name: kchawla-pi) for the Nilearn library in Feb/March 2019.
GPLv3
"""
def replace_parameters(replacement_params,
end_version='future',
lib_name='Nilearn',
):
"""
@ZoomQuiet
ZoomQuiet / build-opencv-for-pyenv.py
Created March 21, 2019 10:17 — forked from pohmelie/build-opencv-for-pyenv.py
Build opencv for ubuntu 16.04 with pyenv
import pathlib
import sys
import sh
def clone_if_not_exists(name, url, **kwargs):
if not pathlib.Path(name).exists():
print("Cloning", url, "...")
sh.git.clone(url, name, depth=1, **kwargs)
@ZoomQuiet
ZoomQuiet / slack_slash_cmd.py
Created October 14, 2018 15:28 — forked from devStepsize/slack_slash_cmd.py
Server-side logic to handle a Slack slash command using Python and Flask
'''
This is an example of the server-side logic to handle slash commands in
Python with Flask.
Detailed documentation of Slack slash commands:
https://api.slack.com/slash-commands
Slash commands style guide:
https://medium.com/slack-developer-blog/slash-commands-style-guide-4e91272aa43a#.6zmti394c
'''
#!/usr/bin/env python
#
# clock_skew.py
# This script reads json data from /tmp/sigsci-agents.json
# and prints a message if an agent's clock skew is greater
# or equal to the defined thresholds.
#
# SigSciApiPy (https://github.com/signalsciences/SigSciApiPy) is
# an easy way to pull agent data from the Signal Sciences API and
# save it to /tmp/sigsci-agents.json
#!/usr/bin/env bash
# clock_skew.sh - Check remote hosts for clock skew (time drift), and
# output a warning or alert message based on defined thresholds.
#
# Instructions:
# Create a hosts.txt file that contains the list of hosts to be checked.
#
# hosts.txt should contain one host entry per line, and username and
# port fields are optional. Format:
#
@ZoomQuiet
ZoomQuiet / gist:eb2de7e594e76587bd65b49e03aee66d
Created October 11, 2018 04:03 — forked from holms/gist:5005629
midnight commander dark color theme
Edit mc’s ini file (either ~/.mc/ini or ~/.config/mc/ini) and look for the line [Colors]. Then, change the line base_color to this:
[Colors]
base_color=linux:normal=white,black:marked=yellow,black:input=,green:menu=black:menusel=white:menuhot=red,:menuhotsel=black,red:dfocus=white,black:dhotnormal=white,black:dhotfocus=white,black:executable=,black:directory=white,black:link=white,black:device=white,black:special=white,black:core=,black:stalelink=red,black:editnormal=white,black