Skip to content

Instantly share code, notes, and snippets.

@munho
munho / Volley.md
Last active August 29, 2015 14:10 — forked from benelog/Volley.md

안드로이드 개발에서 많은 비중을 차지하는 UI패턴은 ListView에서 여러 이미지를 보여주는 Activity입니다. 전형적인 흐름을 정리하면 아래와 같습니다.

​1. 목록조회 API호출

​2. API를 파싱하고 ListView에 데이터를 보여 줌.

​3. 각 아이템마다의 이미지 주소로 다시 서버를 호출

​4. 이미지를 디코딩하고 ImageView에서 보여줌.

@munho
munho / smi2srt.py
Last active August 29, 2015 14:22
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@package smi2srt
@brief this module is for convert .smi subtitle file into .srt subtitle
(Request by Alfred Chae)
Started : 2011/08/08
license: GPL

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@munho
munho / imageset.sh
Created May 16, 2016 23:36 — forked from kukat/imageset.sh
Xcode 5 imageset generator
#!/usr/bin/env bash
SOURCE_PATH=$1
for f in "$SOURCE_PATH"/*.png; do
fullname=$(basename "$f")
filename=${fullname%@2x.*}
imageset="$SOURCE_PATH"/"$filename".imageset
jsonfile="$imageset"/Contents.json
PackageInfo info;
try {
info = getPackageManager().getPackageInfo("ecentinela.mercadotes", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md;
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
@munho
munho / LocalBroadcastExampleActivity.java
Last active March 22, 2017 00:27 — forked from Antarix/LocalBroadcastExampleActivity.java
Simple Example of using LocalBroadcastManager in Android
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
@munho
munho / echo_nc.sh
Created May 3, 2017 23:33 — forked from NapoleonWils0n/echo_nc.sh
bash: hex over tcp with netcat and echo
#!/bin/sh
#----------------------------------------------------------------------------------------#
# Hex over TCP with Echo and Netcat #
#----------------------------------------------------------------------------------------#
echo -n -e "x01x18x03" | nc 192.168.1.4 80
# The -n supresses outputting the trailing newline.
# The -e enables the interpretation of backslash escapes -- allowing us to send hex codes.
@munho
munho / AddCookiesInterceptor.java
Created May 12, 2017 04:45 — forked from nikhiljha/AddCookiesInterceptor.java
Retrofit2/OkHttp3 Cookies (Drag and Drop, One Size Fits 99%)
// Original written by tsuharesu
// Adapted to create a "drop it in and watch it work" approach by Nikhil Jha.
// Just add your package statement and drop it in the folder with all your other classes.
import android.content.Context;
import android.preference.PreferenceManager;
import android.util.Log;
import java.io.IOException;
import java.util.HashSet;
@munho
munho / Info.plist
Created June 26, 2017 03:16 — forked from BalestraPatrick/Info.plist
Custom URL scheme Launch Storyboard Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
package com.alexzh.recyclerviewsetemptyview;
import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
public class EmptyRecyclerView extends RecyclerView {
private View mEmptyView;