Skip to content

Instantly share code, notes, and snippets.

View davydany's full-sized avatar

David Daniel davydany

View GitHub Profile
@davydany
davydany / README.md
Last active October 25, 2017 20:21
Python Thread Pool

Python Thread Pool

Usage

import requests
from threadpool import ThreadPool

def task(url):
 response = requests.get(url)
@davydany
davydany / README.md
Last active November 10, 2017 21:00
For those times you need to edit a jar file which has only 1 XML file with the same name as the jar file (minus the extension), and you just don't want to extract the damn file to access 1 file. Use 'vijar' to simplify your life.

jarjar

Usage

jarjar <executable> <path-to-jar-file>
@davydany
davydany / background.js
Created August 28, 2018 22:35
Snippet showing Firebase working with Electron Background Process
// This is main process of Electron, started as first thing when your
// app starts. It runs through entire life of your application.
// It doesn't have any windows which you can see on screen, but we can open
// window from here.
import path from "path";
import url from "url";
import { app, Menu, protocol } from "electron";
import { devMenuTemplate } from "./menu/dev_menu_template";
import { editMenuTemplate } from "./menu/edit_menu_template";
@davydany
davydany / disks.md
Last active October 5, 2018 21:23
All Things Disks

All Things Disks

This is my personal documentation for dealing with Disks on a Linux Systems. This assumes that we're on CentOS (6.8).

NOTE: This tutorial does not talk about how to attach a disk to your Linux Box, or removing a disk. This is because in a physical machine, you will literally put the disk in or pull it out. On a VM, you will

NOTE: All the commands you run are to be run as root, and so, it will require superuser permissions when running sudo ....

@davydany
davydany / getting-started-postgres.md
Last active May 30, 2023 17:11
Getting Started with PostgreSQL

Getting Started with Postgres

I swap between databases all the time for various projects, and end up Googling and how to do the initial setup all the time, so the purpose of this document is to list a set of commands that anyone would end up using in getting started.

Creating a User

The simplest way to do this, without calling the psql utility and calling the CREATE ROLE and a bunch of other SQL Statements is to use the createuser utility.

@davydany
davydany / README.md
Last active November 21, 2019 16:17
Setting up Django and MySQL Server on a Mac (2019)

Setting up Django and MySQL Server on a Mac (2019)

The following will show how to setup MySQL Server first, and setup Django to work with MySQL. This works with the Mac OS only.

Setup MySQL

Install MySQL with Homebrew

@davydany
davydany / getting-started-mysql.md
Last active August 18, 2024 08:38
Getting Started with MySQL

Getting Started with MySQL

I swap between databases all the time for various projects, and end up Googling on how to do the inital setup all the time, so the purpose of this document is to list a set of commands that anyone would end up using in getting started.

Getting Started with the MySQL Client Console

Login to the MySQL console as the root user, with your password for the root user.

@davydany
davydany / AppleSigninCheck.dart
Created December 21, 2019 11:49
Check for iOS 13 for Apple Signin
// IMPORTANT: I'll need to fix this when we go past iOS 13.
// Assume the following logic is inside a State<StatefulWidget>
supportsAppleSignIn = false;
@override
void initState() {
super.initState();
// initialize the AuthAgent
this.authAgent = AuthAgent();
@davydany
davydany / getting-started-with-go-project.md
Created August 31, 2022 18:20
Getting Started with a Go Project

Getting Started with a Go Project

Install Go

MacOS X

brew install go
@davydany
davydany / capture_stdout.go
Created November 9, 2022 23:16
Go - Capture Stdout from your tests
func startCapturingStdout() {
// capture things from stdout
suite.Old = os.Stdout // keep backup of the real stdout
r, w, _ := os.Pipe()
suite.R = r
suite.W = w
os.Stdout = suite.W