Skip to content

Instantly share code, notes, and snippets.

@rogerhu
rogerhu / Contact.java
Last active June 9, 2022 23:32
Endless scrolling with RecyclerVIew
package codepath.com.recyclerviewfun;
import java.util.ArrayList;
import java.util.List;
public class Contact {
private String mName;
private boolean mOnline;
public Contact(String name, boolean online) {
@rogerhu
rogerhu / MainActivity.java
Created November 30, 2015 09:03
SampleFragmentIconPagerAdapter
package codepath.com.tablayoutfun;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
@rogerhu
rogerhu / google-image-search-walkthrough
Last active September 11, 2023 02:47
Google Image Search
# Google Image Search
- SETUP see 0a_recording.txt BEFORE RECORDING
Keys: Cmd-Shift-O and Cmd-Shift-F
Tabs
- Grid image homework
- Project slides for Grid Image Search
- Guides
In this video, I'm going to walk through a basic but functional ToDo list app.
- Going to rely on the Android Quickstart guide.
- The first step in building an app is scoping and wireframing it.
- Before you build anything, it's important to scope your app.
- We're going to define 3 different user scenarios: user can open the app and view a list, add a new item, and remove an item.
- First version we're not going to have marking completion or setting priority.
- Let's mock out our app to build the simplest wireframe for our app.
- It's important to think about the views and the interactions.
- It comes down to the Action Bar, the list of items vertically scrollable and click to remove,
textbox, and add button which will cause the input to be added to the list.
@rogerhu
rogerhu / core.xml
Last active August 29, 2015 14:25
core.xml
<?xml version="1.0"?>
<root>
<item>
<identifier>emacs_pageup_pagedown</identifier>
<name>Emacs pageup/pagedown</name>
<windowname_only>emacs_terminal</windowname_only>
<device_only>{{ PRODUCT }} </device_only>
<autogen>__KeyToKey__ KeyCode::PAGE_UP, KeyCode::V, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::PAGE_DOWN, KeyCode::V, ModifierFlag::CONTROL_L</autogen>
<autogen>__KeyToKey__ KeyCode::CONTROL_L, KeyCode::CONTROL_L</autogen>
@rogerhu
rogerhu / private.xml
Last active August 29, 2015 14:25
~/Library/Application Support/Karabiner/private.xml
<?xml version="1.0"?>
<root>
<symbol_map type="KeyCode" name="PAGE_UP" value="0x74" />
<symbol_map type="KeyCode" name="PAGE_DOWN" value="0x79" />
<windownamedef>
<name>emacs_terminal</name>
<regex>emacs</regex>
</windownamedef>
import os
import glob
import re
cur_dir = os.getcwd()
source_dir = "%s/projects/material-design-icons/navigation" % os.environ['HOME']
base_dest_dir = "%s/projects/my-android-project/app/src/main/res" % os.environ['HOME']
template = "drawable-%(density)s/ic_%(name)s_%(color)s_%(size)s.png"
@rogerhu
rogerhu / purge.sh
Last active September 16, 2015 18:38
Updated Vagrant purge.sh script for Ubuntu 14.10
#!/bin/sh
# Revised for Ubuntu 14.10.
# Credits to:
# - https://gist.githubusercontent.com/adrienbrault/3775253/raw/da59136ef0414af151b917bd25a06882f0107947/purge.sh
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant
<?xml version="1.0"?>
<root>
<item>
<identifier>emacs_pageup_pagedown_{{ PRODUCT}}</identifier>
<name>Emacs pageup/pagedown</name>
<windowname_only>emacs_terminal</windowname_only>
<device_only>{{ PRODUCT }}, {{ KEY }} </device_only>
<autogen>__KeyToKey__ KeyCode::PAGE_UP, KeyCode::V, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::PAGE_DOWN, KeyCode::V, ModifierFlag::CONTROL_L</autogen>
<autogen>__KeyToKey__ KeyCode::CONTROL_L, KeyCode::CONTROL_L</autogen>
<?xml version="1.0"?>
<root>
<symbol_map type="KeyCode" name="PAGE_UP" value="0x74" />
<symbol_map type="KeyCode" name="PAGE_DOWN" value="0x79" />
<windownamedef>
<name>emacs_terminal</name>
<regex>emacs</regex>
</windownamedef>