Skip to content

Instantly share code, notes, and snippets.

View deven96's full-sized avatar
:shipit:
Too much to learn... so little time

Diretnan Domnan deven96

:shipit:
Too much to learn... so little time
View GitHub Profile
@deven96
deven96 / screenActiveMac.bash
Last active March 19, 2021 12:59
Checking screen is active on Mac
#!/bin/bash
# $screenActive=1 means the screen is active and O is inactive
# View the explanation of the CGSession dictionary at
# https://stackoverflow.com/questions/11505255/osx-check-if-the-screen-is-locked
function checkScreenActiveMac {
python -c 'import sys,Quartz;\
d=Quartz.CGSessionCopyCurrentDictionary();\
sys.exit(d and \
d.get("CGSSessionScreenIsLocked", 0) == 0 and \
@deven96
deven96 / checkOS.bash
Created March 19, 2021 12:13
Check OS
#!/bin/bash
function checkOS {
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
*) echo "Cannot run on unsupported machine ${unameOut}" && exit 1;
esac
@deven96
deven96 / addOneHour.bash
Last active March 19, 2021 12:20
Excuses with Bash
#!/bin/bash
function checkOS {
...
}
function addOneHourLinux {
date -d '+1 hour'
}
@deven96
deven96 / check_convex.py
Created December 23, 2019 11:17 — forked from mblondel/check_convex.py
A small script to get numerical evidence that a function is convex
# Authors: Mathieu Blondel, Vlad Niculae
# License: BSD 3 clause
import numpy as np
def _gen_pairs(gen, max_iter, max_inner, random_state, verbose):
rng = np.random.RandomState(random_state)
# if tuple, interpret as randn
@deven96
deven96 / Dockerfile
Created September 28, 2019 22:57 — forked from Irio/Dockerfile
GCP Serverless scrapers
FROM golang:1.12 as build
WORKDIR $GOPATH/src/github.com/Irio/wohnung
COPY scraper scraper
COPY main.go .
RUN go get -d -v ./...
RUN go install
FROM gcr.io/distroless/base
@deven96
deven96 / traffic-predict.ipynb
Last active May 15, 2019 17:21
Traffic Predict.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deven96
deven96 / multidigitclassification.ipynb
Last active May 17, 2019 22:25
MultiDigitClassification
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.