Function | Shortcut |
---|---|
New Tab | ⌘ + T |
Close Tab or Window | ⌘ + W (same as many mac apps) |
Go to Tab | ⌘ + Number Key (ie: ⌘2 is 2nd tab) |
Go to Split Pane by Direction | ⌘ + Option + Arrow Key |
Cycle iTerm Windows | ⌘ + backtick (true of all mac apps and works with desktops/mission control) |
- Close Android File Transfer
- Open Activity Monitor and kill “Android File Transfer Agent”
- Go to where you installed “Android File Transfer.app” (I have it under /Applications)
- Ctrl+click –> “Show package contents”
- Go to Contents/Resources
- Rename “Android File Transfer Agent” to e.g. “Android File Transfer Agent_DISABLED”
- Then go to “/Users/username/Library/Application Support/Google/Android File Transfer” and again rename the Agent app.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule CommonMacros do | |
defmacro left ~>> right do | |
[{h, _}|t] = Macro.unpipe({:|>, [], [left, right]}) | |
:lists.foldl fn | |
{{_, _, args} = x, _pos}, acc -> | |
pos = Enum.count(args) | |
Macro.pipe(acc, x, pos) | |
{x, pos}, acc -> | |
Macro.pipe(acc, x, pos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Episode do | |
defstruct id: nil, name: nil, video: nil, markdown: nil, post: nil | |
def list do | |
[ | |
%Episode{id: "001", post: "271", name: "Introduction and Installing Elixir", video: "1366", markdown: "1382" }, | |
%Episode{id: "002", post: "275", name: "Basic Elixir", video: "1367", markdown: "1357" }, | |
%Episode{id: "003", post: "280", name: "Pattern Matching", video: "14879", markdown: "1413" }, | |
%Episode{id: "004", post: "284", name: "Functions", video: "5086", markdown: "1559" }, | |
%Episode{id: "005", post: "298", name: "Mix and Modules", video: "5087", markdown: "1654" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Chain do | |
defmacro chain(ex) do | |
parse(ex) | |
end | |
defp parse({:., _, [first_arg, function_name]}, more_args) do | |
args = [first_arg|more_args] |> Enum.map(&parse/1) | |
apply(String, function_name, args) | |
end |
Get Git log in JSON format
git log --pretty=format:'{%n "commit": "%H",%n "abbreviated_commit": "%h",%n "tree": "%T",%n "abbreviated_tree": "%t",%n "parent": "%P",%n "abbreviated_parent": "%p",%n "refs": "%D",%n "encoding": "%e",%n "subject": "%s",%n "sanitized_subject_line": "%f",%n "body": "%b",%n "commit_notes": "%N",%n "verification_flag": "%G?",%n "signer": "%GS",%n "signer_key": "%GK",%n "author": {%n "name": "%aN",%n "email": "%aE",%n "date": "%aD"%n },%n "commiter": {%n "name": "%cN",%n "email": "%cE",%n "date": "%cD"%n }%n},'
The only information that aren't fetched are:
%B
: raw body (unwrapped subject and body)%GG
: raw verification message from GPG for a signed commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enter this command to create a sudoers override/include file: | |
# sudo visudo -f /etc/sudoers.d/nginx.overrides | |
# (Make sure you actually have this in your /etc/sudoers - Run `sudo visudo` to check) | |
# #includedir /etc/sudoers.d | |
# This file assumes your deployment user is `deploy` | |
# Nginx Commands | |
Cmnd_Alias NGINX_RESTART = /usr/sbin/service nginx restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?><!-- | |
~ Copyright (C) 2015 The Android Open Source Project | |
~ | |
~ Licensed under the Apache License, Version 2.0 (the "License"); | |
~ you may not use this file except in compliance with the License. | |
~ You may obtain a copy of the License at | |
~ | |
~ http://www.apache.org/licenses/LICENSE-2.0 | |
~ | |
~ Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env ruby | |
#### This Ruby Script extracts Captions as .srt files from | |
#### MediaStorm Videos (http://mediastorm.com) | |
#### Download The Video, and if you want to download captions, | |
#### lookup the 'Network' tab in Inspector to see the video id | |
#### It'll be a GET request to two xml documents on the mediastorm | |
#### server, namely; /timecodes/<id> and /phrases/<id> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SimpleJSON { | |
/** | |
* @author: Sheharyar Naseer (@sheharyarn) | |
* @license: MIT | |
*/ | |
public static Object toJSON(Object object) throws JSONException { | |
if (object instanceof HashMap) { | |
JSONObject json = new JSONObject(); | |
HashMap map = (HashMap) object; |