Skip to content

Instantly share code, notes, and snippets.

View namchuai's full-sized avatar

NamH namchuai

View GitHub Profile
@v-yarotsky
v-yarotsky / .tmux.conf
Created March 22, 2012 11:57
Mac OS X tmux config
### INSTALLATION NOTES ###
# 1. Install Homebrew (https://github.com/mxcl/homebrew)
# 2. brew install zsh
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh)
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace
# 5. Install iTerm2
# 6. In iTerm2 preferences for your profile set:
# Character Encoding: Unicode (UTF-8)
# Report Terminal Type: xterm-256color
# 7. Put itunesartist and itunestrack into PATH
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@devunwired
devunwired / GifDecoder.java
Last active January 26, 2024 21:14
An optimized implementation of GifDecoder for Android devices.
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@jlafon
jlafon / dynamodb.md
Created December 3, 2014 05:03
An Introduction to Amazon's DynamoDB

An introduction to DynamoDB

DynamoDB is a powerful, fully managed, low latency, NoSQL database service provided by Amazon. DynamoDB allows you to pay for dedicated throughput, with predictable performance for "any level of request traffic". Scalability is handled for you, and data is replicated across multiple availability zones automatically. Amazon handles all of the pain points associated with managing a distributed datastore for you, including replication, load balancing, provisioning, and backups. All that is left is for you to take your data, and its access patterns, and make it work in the denormalized world of NoSQL.

Modeling your data

The single most important part of using DynamoDB begins before you ever put data into it: designing the table(s) and keys. Keys (Amazon calls them primary keys) can be composed of one attribute, called a hash key, or a compound key called the hash and range key. The key is used to uniquely identify an item in a table. The choice of the primary key is particularl

@cjaoude
cjaoude / gist:fd9910626629b53c4d25
Last active April 4, 2024 18:17
Test list of Valid and Invalid Email addresses
Use: for testing against email regex
ref: http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses
List of Valid Email Addresses
email@example.com
firstname.lastname@example.com
email@subdomain.example.com
firstname+lastname@example.com
@ftvs
ftvs / PhonecallReceiver.java
Last active October 11, 2023 10:05
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: Gabe Sechan http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@gohilbhagirath90
gohilbhagirath90 / circle.xml
Last active June 15, 2019 10:20
list item with left side half circle android
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false" >
<solid android:color="@android:color/white" />
<size
android:height="50dp"
android:width="50dp" />
</shape>
@marty-wang
marty-wang / gist:5a71e9d0a6a2c6d6263c
Last active February 13, 2024 07:34
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@slightfoot
slightfoot / MovingBgTextureView.java
Last active December 13, 2023 09:42
Playing around with SurfaceView/TextureView. See edit history.
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.SurfaceTexture;
import android.os.Build;
import android.text.TextPaint;
import android.util.AttributeSet;