Skip to content

Instantly share code, notes, and snippets.

@vikks
vikks / xcrun_simctl_cheatsheet.md
Created June 16, 2024 11:30 — forked from patriknyblad/xcrun_simctl_cheatsheet.md
iOS Simulator Terminal Commands `$ xcrun simctl`

Managing iOS Simulators

List all simulators created

$ xcrun simctl list --json

Delete old and unavailable simulators

$ xcrun simctl delete unavailable
@vikks
vikks / delete-likes-from-twitter.md
Created June 7, 2020 12:28 — forked from aymericbeaumet/delete-likes-from-twitter.md
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@vikks
vikks / purgeAndroid.txt
Created February 14, 2018 08:32 — forked from tahmidsadik/purgeAndroid.txt
How to completely remove Android Studio from Mac OS X
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*
@vikks
vikks / .rspec
Created December 6, 2012 11:38 — forked from tenderlove/.rspec
Active Record Spec Helper - Loading just active record
--colour
-I app
@vikks
vikks / issues_with_modules.md
Created November 30, 2012 19:02 — forked from ryanb/issues_with_modules.md
Points on how modules can make code difficult to read.

My issues with Modules

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
@vikks
vikks / .tmux.conf
Created June 21, 2012 12:45 — forked from adambair/.tmux.conf
j2fly's vim setup, install with: exec 3<&1;bash <&3 <(curl https://raw.github.com/gist/2040114/vim.sh 2> /dev/null)
# 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
@vikks
vikks / application.rb
Created June 20, 2012 08:57 — forked from hmcfletch/application.rb
Rails project wide and personal configuration files
require File.expand_path('../boot', __FILE__)
require 'rails/all'
module MyApp
class Application < Rails::Application
# you app configuration code
end
end
@vikks
vikks / app.coffee
Created May 3, 2012 04:42 — forked from mikeobrien/app.coffee
Lazy loading backbone collection + infinite scrolling
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
@vikks
vikks / create.lua
Created April 24, 2012 14:18 — forked from cyx/create.lua
local namespace = KEYS[1]
local attributes = ARGV
local model = {
id = namespace .. ":id",
all = namespace .. ":all",
uniques = namespace .. ":uniques",
indices = namespace .. ":indices",
key = namespace .. ":%s"
}