Skip to content

Instantly share code, notes, and snippets.

View pqnga's full-sized avatar

ngapham@kobiton.com pqnga

  • Ho Chi Minh City, Vietnam
View GitHub Profile
We couldn’t find that file to show.
@pqnga
pqnga / md-cal.sh
Created October 3, 2021 04:05 — forked from chrxn/md-cal.sh
Generate markdown table calendar. Use wiki links to individual days
# modified to use gdate for macos -- obtain 'gdate' by running `brew install coreutils`
startdate=2020-01-01
enddate=2020-12-31
# controls the link format for each day:
# [[ $linkformat | $displayformat ]]
linkformat="%Y-%b-%d-%a"
displayformat="%d"
# marker for empty days in calendar view
@pqnga
pqnga / android_instructions_23.md
Last active September 25, 2019 04:21 — forked from agrcrobles/android_instructions_29.md
Setup Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

@pqnga
pqnga / count_number_of_files_with_a_specific_pattern_in_a_directory
Created May 2, 2014 07:31
Count number of files with a specific pattern in a directory
find . -type f -name '*.m' | wc -l
@pqnga
pqnga / count_all_lines_of_code_in_a_directory_sorted
Created May 1, 2014 03:13
Explore all files in a directory and print out the file name and the number of lines in that file, sorted from large to small
# Explore all files in a directory and print out the file name and the number of lines in that file, sorted from large to small
# http://stackoverflow.com/questions/1358540/how-to-count-all-the-lines-of-code-in-a-directory-recursively
find . -name '*.m' | xargs wc -l | sort -nr
@pqnga
pqnga / symbolicate_ios_crash_log.rb
Last active August 29, 2015 14:00
This script help symbolicate an ios crash log
# Author: @pqnga
# This gist is inspired from an answer from stackoverlow.com
# http://stackoverflow.com/questions/13574933/ios-crash-reports-atos-not-working-as-expected/13576028#13576028
# Use it when you want to symbolicate a crash log like this:
# 5 MyApp 0x0044e89a 0x29000 + 4348058
def symbolicate(app_file, architecture, log_line)
cmd_get_slide = "otool -arch #{architecture} -l #{app_file} | grep -B 3 -A 8 -m 2 \"__TEXT\""
result = %x[#{cmd_get_slide}]