Skip to content

Instantly share code, notes, and snippets.

Avatar

Philip Simpson geekygecko

View GitHub Profile
@geekygecko
geekygecko / cheatsheet.kt
Last active May 29, 2016
Kotlin beginners cheatsheet
View cheatsheet.kt
fun main(args: Array<String>) {
// when statement
val firstName = "Dan"
val job = when (firstName) {
"Dan", "Jay", "Philip" -> "programmer"
"Jamie" -> "designer"
else -> "boss"
}
println("$firstName is a $job")
@geekygecko
geekygecko / android.md
Last active Jul 27, 2019
Android Cheat Sheet
View android.md

Android Cheat Sheet

Developer tips

Record a video of your app

Developer options -> Check show touches
adb shell screenrecord /sdcard/video.mp4
adb pull /sdcard/video.mp4
@geekygecko
geekygecko / bash.md
Last active Aug 29, 2015
Bash Cheet Sheet
View bash.md

Bash Cheat Sheet

Basics

# declare the file as a bash script
#!/bin/bash
# debug a script
bash -x script.sh
# variables
View homebrew.sh
# Howebrew package manager for OS X is useful for installing unix terminal tools.
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
# Install wget
brew install wget
brew install openssl
# Update homebrew and all your packages
View scripts.rb
# header
#!/usr/bin/env ruby
# require gem libraries
require 'rubygems'
require 'fileutils'
# get the current directory
dir = File.expand_path(File.dirname(__FILE__))
View rvm.sh
# Update your RVM to the latest statble version.
rvm get latest
# Update your RVM to the most recent version. (most bug fixes)
rvm get head
# Reinstall all your Rails gemset gems
rvm gemset empty project_gem_set && gem install bundler && bundle install
# How to fix Mac issue: `require': no such file to load -- iconv
You can’t perform that action at this time.