Skip to content

Instantly share code, notes, and snippets.

Avatar

Firoze Rakib firoze

  • Mobiquity Inc.
View GitHub Profile
@tikipatel
tikipatel / sierpinski_chaos.py
Created Apr 29, 2017
Generate Sierpinski Triangle with random numbers
View sierpinski_chaos.py
'''
Chaos Game Sierpinski Triangle
Reference: https://www.youtube.com/watch?v=kbKtFN71Lfs
'''
import random
import matplotlib.pyplot as plt
from numpy.random import rand
def midPoint(p1, p2):
return ((p1[0] + p2[0]) / 2.0, (p1[1] + p2[1]) / 2.0)
@bcomnes
bcomnes / git-gpg.md
Last active Jul 23, 2020
my version of gpg on the mac
View git-gpg.md
  1. brew install gnupg, pinentry-mac (this includes gpg-agent and pinentry)

  2. Generate a key: $ gpg --gen-key

  3. Take the defaults. Whatevs

  4. Tell gpg-agent to use pinentry-mac:

    $ vim ~/.gnupg/gpg-agent.conf 
    
@thefotes
thefotes / dupeImports.sh
Created Jun 28, 2015
Given a path to an Xcode project, loops through all files and checks to see if any files have been imported more than once in the same file.
View dupeImports.sh
#!/bin/bash
set -e
read -e -p "Enter path to Xcode project: " FILES
eval FILES=$FILES
find "$FILES" -type f \( -name "*.h" -or -name "*.m" \) | while read -r f;
do
View void-might-be-useful.js
function runner(cb) {
if (Math.round(Math.random())) {
return void cb("error");
}
return void cb();
}
function callback(err) {
if (err) {
console.error(err);
View flat-promises.es6
Promise.resolve()
.then(() => Promise.resolve(">"))
.then(() => Promise.resolve(">>"))
.then(() => Promise.resolve(">>>"))
.then(() => Promise.resolve(">>>>"))
.then(() => Promise.resolve(">>>>>"))
.then(() => Promise.resolve(">>>>>>"))
.then(() => Promise.resolve(">>>>>>>"))
.then(() => Promise.resolve(">>>>>>>"))
.then(() => Promise.reject("get me out!"))
View FloatLabelLayout.java
/*
* Copyright (C) 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View FloatLabelLayout.java
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@lttlrck
lttlrck / gist:9628955
Created Mar 18, 2014
rename git branch locally and remotely
View gist:9628955
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@wbroek
wbroek / genymotionwithplay.txt
Last active Aug 8, 2020
Genymotion with Google Play Services for ARM
View genymotionwithplay.txt
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@mxl
mxl / PageSplitter.java
Last active Dec 29, 2015
Class for splitting styled text to pages.
View PageSplitter.java
package com.codeoverdrive.util;
import android.graphics.Typeface;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.style.StyleSpan;
import java.util.ArrayList;
import java.util.List;
You can’t perform that action at this time.