Skip to content

Instantly share code, notes, and snippets.

View w-k-s's full-sized avatar

Waqqas Sheikh w-k-s

View GitHub Profile
@w-k-s
w-k-s / work-with-multiple-github-accounts.md
Last active June 23, 2025 04:58 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@w-k-s
w-k-s / mtgox.php
Created May 23, 2025 20:22 — forked from alainmeier/mtgox.php
This is an alleged dump of some of MtGox.com's source code.
<?php
namespace Money;
class Bitcoin {
#const BITCOIN_NODE = '173.224.125.222'; // w001.mo.us temporary
const BITCOIN_NODE = '50.97.137.37';
static private $pending = array();
public static function update() {
@w-k-s
w-k-s / README.md
Created February 14, 2025 18:36
Extracting files from Docker Images
  1. View Files in Docker Image

    brew install dive
    dive grycap/cowsay:latest
    

Find the folder of interest from dive (you can use control-M to hide modified files, control-R to hide removed files, control-B to hide file attribites, so that you only see files added to the docker image). See commands here

@w-k-s
w-k-s / generate-pushid.js
Created July 14, 2024 07:43 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@w-k-s
w-k-s / main.go
Last active November 21, 2018 20:22
Collecting data from multiple API requests using a select statement
// Extended example of using select statements to collect data from multiple API requests
// Written by: Waqqas Sheikh (https://www.github.com/w-k-s)
// For: Dubai DevFest 2018 (https://www.meetup.com/en-AU/GDG-Dubai/events/253941428/)
package main
import (
"encoding/json"
"errors"
"fmt"
@w-k-s
w-k-s / APIRequest.swift
Created August 21, 2017 19:44
APIRequest
//
// APIRequest.swift
// Asfour
//
// Created by Waqqas Sheikh on 20/08/2017.
// Copyright © 2017 Waqqas Sheikh. All rights reserved.
//
import Foundation
@w-k-s
w-k-s / gcd.clj
Last active July 23, 2017 19:22
Greatest Common Denominator
;tutorial: http://www.braveclojure.com/do-things/
(defn gcd
[a b]
(loop [dividend (max a b), divisor (min a b)]
(def remainder (rem dividend divisor))
(if (= remainder 0)
divisor
(recur divisor remainder)))
)
(gcd 32 5);1