Skip to content

Instantly share code, notes, and snippets.

View achalaggarwal's full-sized avatar
🎯
Focusing

Achal Aggarwal achalaggarwal

🎯
Focusing
View GitHub Profile
@achalaggarwal
achalaggarwal / iterm2-solarized.md
Created March 16, 2017 07:30 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@achalaggarwal
achalaggarwal / UIViewController+Deselection.swift
Created June 3, 2016 19:53 — forked from ZevEisenberg/LICENSE
Smoothly deselect table and collection view cells on dismissal, including interactive dismiss and interactively-partially-dismiss-then-cancel-then-dismiss-again
extension UIViewController {
func rz_smoothlyDeselectRows(tableView tableView: UITableView?) {
let selectedIndexPaths = tableView?.indexPathsForSelectedRows ?? []
if let coordinator = transitionCoordinator() {
coordinator.animateAlongsideTransitionInView(parentViewController?.view, animation: { context in
selectedIndexPaths.forEach {
tableView?.deselectRowAtIndexPath($0, animated: context.isAnimated())
}
@achalaggarwal
achalaggarwal / osx-for-hackers.sh
Created December 21, 2015 19:12 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@achalaggarwal
achalaggarwal / macos-apps.sh
Created December 21, 2015 19:04 — forked from cstipkovic/install_my_env.sh
My Mac OS X setup script
#!/bin/sh
# homebrew-cask
brew tap phinze/homebrew-cask
brew install brew-cask
# browser
brew cask install firefox
# development
@achalaggarwal
achalaggarwal / osx_lion_rail_setup.md
Created June 22, 2012 21:00 — forked from jpantuso/osx_lion_rail_setup.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL
@achalaggarwal
achalaggarwal / hack.sh
Created April 2, 2012 11:32 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@achalaggarwal
achalaggarwal / top3stories.js
Created August 19, 2011 16:00 — forked from DTrejo/top3stories.js
Gets top three articles from frontpage and newpage of Hacker News. Blog post on scraping: http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga
// Scraping Made Easy with jQuery and SelectorGadget
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga)
// by David Trejo
//
// Install node.js and npm:
// http://joyeur.com/2010/12/10/installing-node-and-npm/
// Then run
// npm install jsdom jquery http-agent
// node numresults.js
//
@achalaggarwal
achalaggarwal / UIImage+PSPDFKitAdditions.m
Created August 16, 2011 09:32 — forked from steipete/UIImage+PSPDFKitAdditions.m
Preload UIImage for super-smooth interaction. especially great if you use JPGs, which otherwise produce a noticeable lag on the main thread.
- (UIImage *)pspdf_preloadedImage {
CGImageRef image = self.CGImage;
// make a bitmap context of a suitable size to draw to, forcing decode
size_t width = CGImageGetWidth(image);
size_t height = CGImageGetHeight(image);
CGColorSpaceRef colourSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef imageContext = CGBitmapContextCreate(NULL, width, height, 8, width*4, colourSpace,
kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little);