Skip to content

Instantly share code, notes, and snippets.

Avatar
🔬
R&D

Maz Jaleel Mazyod

🔬
R&D
View GitHub Profile
@Mazyod
Mazyod / watchdog.py
Last active Apr 13, 2019
Directory/files watchdog in Python
View watchdog.py
import os
import logging
from queue import Queue, Empty as EmptyQueue
from time import sleep
from threading import Thread
from typing import List
logger = logging.getLogger("watchdog")
@mrw34
mrw34 / postgres.sh
Last active Jan 21, 2021
Enabling SSL for PostgreSQL in Docker
View postgres.sh
#!/bin/bash
set -euo pipefail
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem
openssl rsa -in privkey.pem -passin pass:abcd -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod 600 server.key
test $(uname -s) == Linux && chown 70 server.key
docker run -d --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v "$(pwd)/server.crt:/var/lib/postgresql/server.crt:ro" -v "$(pwd)/server.key:/var/lib/postgresql/server.key:ro" postgres:12-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
@maciekish
maciekish / resetXcode.sh
Created Aug 10, 2016
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
View resetXcode.sh
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app
@heiswayi
heiswayi / Bindable.cs
Created Jun 5, 2016 — forked from btshft/Bindable.cs
Bindable class to reduce boilerplate code in mvvm (implement INotifyPropertyChanged)
View Bindable.cs
namespace Helpers
{
///<summary>
/// Reduce mvvm boilerplate
///
/// Usage:
/// public class MyViewModel : Bindable {
/// // Now this property supports INotifyPropertyChanged
/// public string MyProperty
/// {
@mteece
mteece / timezone.md
Last active Apr 15, 2020
List of NSTimeZone Abbreviations and Names (iOS 9.3.1)
View timezone.md

NSTimeZone - Timezone Abbreviations ADT = "America/Halifax"; AKDT = "America/Juneau"; AKST = "America/Juneau"; ART = "America/Argentina/Buenos_Aires"; AST = "America/Halifax"; BDT = "Asia/Dhaka"; BRST = "America/Sao_Paulo"; BRT = "America/Sao_Paulo"; BST = "Europe/London";

View upgrade.md

#Phoenix 1.1.x to 1.2.0 Upgrade Instructions

Project Generator

To generate new projects as 1.2.0, install the new mix archive:

mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

Deps

@Humoud
Humoud / facts_rules.pl
Created Mar 21, 2016
Some notes I gathered on Prolog. Consider this a mini intro to Prolog. Will improve this gist as I continue to learn Prolog.
View facts_rules.pl
/*
To run this:
open command prompt execute 'swipl'
then run ['path/to/this/file.pl'].
then query away.
*/
% FACTS
likes(jana, omar).
likes(omar, jana).
@Mazyod
Mazyod / Dockerfile
Last active Jan 5, 2016
Poco C++ Backend Starter Dockerfile
View Dockerfile
FROM ubuntu
MAINTAINER Maz Jaleel <mazjaleel@gmail.com>
# Install necessary tools to build Poco
RUN apt-get update && apt-get install -yq \
unzip wget build-essential cmake \
openssl libssl-dev \
unixODBC unixODBC-dev odbc-postgresql
@radex
radex / hard-reproductions.md
Last active Jan 30, 2016
Trouble reproducing a bug? Run this checklist.
View hard-reproductions.md

Trouble reproducing a bug? Run this checklist to make sure you're reproducing user's environment as closely as possible:

Device

  • iOS version?
  • iPad/iPhone?
  • CPU architecture?
  • Screen size? Orientation? Slide-over/Split View?

iOS settings

View dev.exs
config :my_app, :twitter_api,
client: Twitter.SandboxClient