$ xcrun simctl list --json
$ xcrun simctl delete unavailable
Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.
setInterval(() => {
for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
d.click()
}| How to Completely Remove Android Studio | |
| Execute these commands from the terminal | |
| rm -Rf /Applications/Android\ Studio.app | |
| rm -Rf ~/Library/Preferences/AndroidStudio* | |
| rm ~/Library/Preferences/com.google.android.studio.plist | |
| rm -Rf ~/Library/Application\ Support/AndroidStudio* | |
| rm -Rf ~/Library/Logs/AndroidStudio* |
| https://gist.github.com/6184489 |
| --colour | |
| -I app |
In researching topics for RailsCasts I often read code in Rails and other gems. This is a great exercise to do. Not only will you pick up some coding tips, but it can help you better understand what makes code readable.
A common practice to organize code in gems is to divide it into modules. When this is done extensively I find it becomes very difficult to read. Before I explain further, a quick detour on instance_eval.
You can find instance_eval used in many DSLs: from routes to state machines. Here's an example from Thinking Sphinx.
class Article < ActiveRecord::Base| # Our .tmux.conf file | |
| # Setting the prefix from C-b to C-a | |
| # START:prefix | |
| set -g prefix C-a | |
| # END:prefix | |
| # Free the original Ctrl-b prefix keybinding | |
| # START:unbind | |
| unbind C-b |
| require File.expand_path('../boot', __FILE__) | |
| require 'rails/all' | |
| module MyApp | |
| class Application < Rails::Application | |
| # you app configuration code | |
| end | |
| end |
| class LazyCollection extends Backbone.Collection | |
| indexQuerystring: 'index' | |
| index: 1 | |
| lastLength: 0 | |
| fetch: (options) -> | |
| options or= {} | |
| if options.reset | |
| @index = 1 | |
| @lastLength = 0 | |
| else |
| class ActionDispatch::Routing::Mapper | |
| def draw(routes_name) | |
| instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
| end | |
| end | |
| BCX::Application.routes.draw do | |
| draw :api | |
| draw :account | |
| draw :session |