Skip to content

Instantly share code, notes, and snippets.

View programmer-ke's full-sized avatar
☁️
in the cloud

KE programmer programmer-ke

☁️
in the cloud
  • Nairobi, Kenya
View GitHub Profile
@programmer-ke
programmer-ke / .el
Last active December 1, 2023 05:51
Easily start scaffold-eth commands in separate terminals in emacs
;; Easily start/stop the scaffold eth commands in separate terminals
;; Ensure you're in the scaffold-eth root directory
;; terminal names: *yarn-chain*, *yarn-start*, *yarn-deploy*
;; run with M-x scaffold-eth... Optionally map to keybinding
(defun scaffold-eth/stop ()
(interactive)
(ignore-errors (kill-buffer "*yarn-deploy*"))
(ignore-errors (kill-buffer "*yarn-start*"))
(ignore-errors (kill-buffer "*yarn-chain*")))
@programmer-ke
programmer-ke / gist:9665fa4ea00013d70278f3be011b19b6
Last active April 24, 2021 08:32
Device Manager Code 10 Error while using the Xiaomi Mi Unlock tool in Virtualbox
This is probably an issue to do with the not being able to correctly
utilize the usb2.0 connection on your computer from within Windows in virtualbox.
First thing to confirm is that you have the virtualbox extension pack
installed. By default, virtualbox ships with usb 1.0 support.
The virtualbox extension pack will add support for usb 2.0, 3.0 among
other features. You can find the extension pack from the official
virtualbox website: https://www.virtualbox.org/wiki/Downloads
Next, ensure that you've added the USB device to the guest
<!-- <h1> This is a H1 header </h1> -->
<h2> This is a H2 header </h2>
<!-- <p> This is a paragraph </p> -->
@programmer-ke
programmer-ke / binary_print.c
Last active March 8, 2017 08:11
Print out a bits in an unsigned integer in C
void binary_print(unsigned int value) {
unsigned int mask = 0xff000000; // start with a mask for the highest byte
unsigned int shift = 256*256*256; // start with a shift for the highest byte
unsigned int byte, byte_iterator, bit_iterator;
for(byte_iterator=0; byte_iterator < 4; byte_iterator++) {
byte = (value & mask) / shift; // isolate each byte
printf(" ");
for(bit_iterator=0; bit_iterator < 8; bit_iterator++) { // print the byte's bits
if(byte & 0x80) // if the highest bit in the byte isn't 0
@programmer-ke
programmer-ke / snowden-ietf93.md
Last active August 29, 2015 14:27 — forked from mnot/snowden-ietf93.md
Transcript of Edward Snowden's comments at IETF93.
@programmer-ke
programmer-ke / gist:4689948
Created February 1, 2013 07:38
Broken necklace
/*Author: Daniel Bundala*/
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
FILE *in,*out;
@programmer-ke
programmer-ke / mathlib.py
Created November 24, 2012 06:51
basic math functions
def add(a, b):
"""Takes in two numbers and returns their sum"""
return a + b
def sub(a, b):
"""Takes in two numbers and returns their difference"""
return a - b
def multiply(a, b):
"""Takes in two numbers and returns their product"""