Skip to content

Instantly share code, notes, and snippets.

View vyder's full-sized avatar
🌊

Vidur vyder

🌊
View GitHub Profile
@vyder
vyder / rbenv-in-xcode-build-script.md
Created October 17, 2016 09:24
Using rbenv in an XCode 'Run Script Phase'

If anybody stumbles across this from Google, I found that the simplest thing to do was:

Have devs install rbenv on their machines, and add ~/.rbenv/shims to the PATH in the XCode build script like:

export PATH=~/.rbenv/shims:$PATH
# Exec rest of your script
# ...

@vyder
vyder / alternative.md
Last active October 6, 2016 07:08
Writing a disk image to a flash drive/SD card from OSX

Or, just install hypriot/flash and run:

$ flash /path/to/img

It also prints a pretty progress bar for dd, which is incredibly useful.

@vyder
vyder / spec.md
Last active September 3, 2016 05:25
Mars Rover Coding Question

MARS ROVERS SPEC

A squad of robotic rovers are to be landed by NASA on a plateau on Mars. This plateau, which is curiously rectangular, must be navigated by the rovers so that their on-board cameras can get a complete view of the surrounding terrain to send back to Earth.

A rover's position and location is represented by a combination of x and y co-ordinates and a letter representing one of the four cardinal compass points. The plateau is divided up into a grid to simplify navigation. An

@vyder
vyder / GAME_MASTER_v0_1.protobuf
Created July 17, 2016 09:55 — forked from anonymous/GAME_MASTER_v0_1.protobuf
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
@vyder
vyder / activate-window
Last active April 16, 2016 05:46
Shell script to activate an open window using 'wmctrl'
#!/bin/bash
# First check if wmctrl is installed
type wmctrl > /dev/null
if [ "$?" != "0" ]; then
cat <<EOF
Please install 'wmctrl' before running this script:
sudo apt-get install wmctrl
@vyder
vyder / iterm
Last active February 6, 2025 17:43
iterm.bash - Launch iTerm from command line
#!/bin/bash
#
# Open new iTerm window from the command line
#
# Usage:
# iterm Opens the current directory in a new iTerm window
# iterm [PATH] Open PATH in a new iTerm window
# iterm [CMD] Open a new iTerm window and execute CMD
# iterm [PATH] [CMD] ... You can prob'ly guess
#
@vyder
vyder / commands.sh
Last active December 1, 2015 05:48
Install RBenv + Ruby
VERSION_TO_INSTALL='2.2.2'
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export RBENV_ROOT='${HOME}/.rbenv"' >> ~/.bash_profile
echo 'if [ -d "${RBENV_ROOT}" ]; then' >> ~/.bash_profile
echo ' export PATH="${RBENV_ROOT}/bin:${PATH}"' >> ~/.bash_profile
echo ' eval "$(rbenv init -)"' >> ~/.bash_profile
echo 'fi' >> ~/.bash_profile
source ~/.bash_profile
@vyder
vyder / gravatar
Created June 9, 2015 05:11
Quick script to find Gravatar profiles
echo "=> http://www.gravatar.com/$(md5 -s $1 | cut -d' ' -f 4).json"
@vyder
vyder / javascript.nanorc
Created February 22, 2015 10:03
JS Nano Syntax Highlighting
## Author: Vidur Murali
## Date : 02/21/2015
##
## Based on Spacegray Eighties Palette
## Link: https://github.com/vyder/color-palettes/blob/master/Spacegray%20Eighties.clr
##
## Notes for future me:
## > Word demarkers like - "[[:<:]]", "[[:>:]]", "\b" - don't work
## in OSX. Use "[[:<:]]", etc instead.
## [Source: http://stackoverflow.com/a/19805937/834459]
@vyder
vyder / script
Last active August 29, 2015 14:12
OSX - Disk image to USB drive
# Convert iso to img
hdiutil convert -format UDRW -o ~/Desktop/target.img ~/Desktop/ubuntu.iso
# Find the USB drive
diskutil list
# Unmount the drive
diskutil unmountDisk /dev/disk<N>
# Write the file