Skip to content

Instantly share code, notes, and snippets.


Lucas Paul L4grange

View GitHub Profile
staltz /
Last active Dec 3, 2020
The introduction to Reactive Programming you've been missing
adamawolf / Apple_mobile_device_types.txt
Last active Dec 3, 2020
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
View Apple_mobile_device_types.txt
i386 : iPhone Simulator
x86_64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
iPhone5,1 : iPhone 5 (GSM)
lopspower /
Last active Dec 1, 2020
Hexadecimal color code for transparency

Hexadecimal color code for transparency


How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

DanHerbert /
Last active Nov 30, 2020
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

READ THIS Very Important Update

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

alexeds /
Created Sep 5, 2012
Move your stashes from one repo to another

Move your stashes from one repo to another

This was useful for me when we created a new branch for a new major release, but were still working on our current version as well. I cloned our repo again and kept the new project on our new branch, but also wanted to get my stashes there.

Download your stashes

git stash show -p > patch

You'll have to specify your stash and name your file whatevery you want. Do this for as all your stashes, and you'll have patch files in your pwd.

WadeShuler /
Last active Nov 23, 2020
Mac Bash script to kill Adobe Create Cloud and other processes that Adobe forces on us.
echo "\n\n--- Killing Stupid Adobe Auto Load Crap ---\n\n"
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
launchctl unload -w /Library/LaunchAgents/com.adobe.AAM.Updater-1.0.plist
echo "\n\n--- Done! ---\n\n"
sonnguyen0310 / gist:6720cbf39ce877c20fea1a987543fb99
Created Jul 2, 2018
iOS 11: Change size of UIBarButtonItem (image) in Swift 3
View gist:6720cbf39ce877c20fea1a987543fb99
func setUpMenuButton(){
let menuBtn = UIButton(type: .custom)
menuBtn.frame = CGRect(x: 0.0, y: 0.0, width: 20, height: 20)
menuBtn.setImage(UIImage(named:"menuIcon"), for: .normal)
menuBtn.addTarget(self, action: #selector(vc.onMenuButtonPressed(_:)), for: UIControlEvents.touchUpInside)
let menuBarItem = UIBarButtonItem(customView: menuBtn)
let currWidth = menuBarItem.customView?.widthAnchor.constraint(equalToConstant: 24)
currWidth?.isActive = true
let currHeight = menuBarItem.customView?.heightAnchor.constraint(equalToConstant: 24)
rosterloh /
Created Aug 18, 2014
Android class for GPIO control
public class GPIO {
public String port;
public int pin;
//get direction of gpio
public String getInOut()
String command = String.format("cat /sys/class/gpio/%s/direction",this.port);
try {
liangzhitao /
Last active Oct 16, 2020
Add column spacing in RecyclerView with GridLayoutManager

Android Recyclerview GridLayoutManager column spacing Here is the question, the first answer does not work well in my project,and it makes the spacing bigger between item and item. the second answer is quite perfect.But if RecyclerView has headers,it does not work well. Then I fixed it.

import android.view.View;

yano3 / gist:1378948
Created Nov 19, 2011
git commit --amend --reset-author
View gist:1378948
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global "Your Name"
git config --global
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
You can’t perform that action at this time.