Skip to content

Instantly share code, notes, and snippets.

View nvd's full-sized avatar

Naveed Siddiqui nvd

  • Sydney, Australia
View GitHub Profile
@mgrebenets
mgrebenets / git-hooks.md
Last active August 29, 2015 14:22
Git Hooks

Git Hooks

Use git hooks to automatically add JIRA ID at the start of each commit message.

Main Project Repo

Navigate to the root of the main project repository.

Create a copy of .git/hooks/commit-msg.sample and name it commit-msg.

@traumverloren
traumverloren / doorkeeper.rb
Last active March 10, 2022 10:27
doorkeeper config for redirect back to client app after login with oauth2 provider
#########################
# config/initializers/doorkeeper.rb
#########################
Doorkeeper.configure do
# Change the ORM that doorkeeper will use.
# Currently supported options are :active_record, :mongoid2, :mongoid3, :mongo_mapper
orm :active_record
# This block will be called to check whether the resource owner is authenticated or not.
@shadcn
shadcn / gist:de147c42d7b3063ef7bc
Last active September 17, 2022 11:50
Convert a Hex string to UIColor in Swift
// Creates a UIColor from a Hex string.
func colorWithHexString (hex:String) -> UIColor {
var cString:String = hex.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).uppercaseString
if (cString.hasPrefix("#")) {
cString = cString.substringFromIndex(1)
}
if (countElements(cString) != 6) {
return UIColor.grayColor()
@mgomes1
mgomes1 / examples.js
Last active August 29, 2015 14:01
MongoDB Examples
// FINDING OUR WAY
show dbs
use examples
show collections
// DATA LOADING
function loadData() {
db.users.insert([
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active June 16, 2024 10:16
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@mpeteuil
mpeteuil / rubocop_pre_commit_hook
Created August 3, 2013 17:44
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified.
#!/usr/bin/env ruby
require 'english'
require 'rubocop'
ADDED_OR_MODIFIED = /A|AM|^M/.freeze
changed_files = `git status --porcelain`.split(/\n/).
select { |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED
@logicmd
logicmd / zsh.md
Created November 5, 2012 02:41 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu

Installation

Install zsh and git, remove any previous installed files

sudo apt-get install zsh git
rm -r ~/.oh-my-zsh

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

@steveclarke
steveclarke / capybara.md
Created April 10, 2012 17:32
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)
@udzura
udzura / make.log
Created March 15, 2012 02:42
Failure building ruby-1.9.3p125 on Mac OS X Lion
[2012-03-15 11:28:24] make
CC = clang
LD = ld
LDSHARED = clang -dynamiclib
CFLAGS = -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -fno-common -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I. -I.ext/include/x86_64-darwin11.3.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -install_name /Users/ukondo/.rvm/rubies/ruby-1.9.3-p125/lib/libruby.1.9.1.dylib -current_version 1.9.1 -compatibility_version 1.9.1 -Wl,-unexported_symbol,_Init_* -Wl,-unexported_symbol,*_threadptr_* -Wl,-u,_objc_msgSend
SOLIBS =
compiling main.c

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: