Skip to content

Instantly share code, notes, and snippets.

@dnszero
dnszero / git_submodules.md
Created October 22, 2018 16:45 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@dnszero
dnszero / get_kc.py
Created April 24, 2017 17:41 — forked from greinacker/get_kc.py
Workflow/Pythonista samples for saving/retrieving from keychain
# coding: utf-8
import sys
import keychain
import clipboard
import webbrowser
key = sys.argv[1]
value = keychain.get_password("workflow", key)
if value != None:

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@dnszero
dnszero / gist:f74d34c79f18434afcaf
Last active August 29, 2015 14:02 — forked from askehansen/gist:6809825
Parsley config for twitter bootstrap 3.x
$.fn.parsley.defaults =
# basic data-api overridable properties here..
inputs: "input, textarea, select" # Default supported inputs.
excluded: "input[type=hidden], :disabled" # Do not validate input[type=hidden] & :disabled.
trigger: false # $.Event() that will trigger validation. eg: keyup, change..
animate: true # fade in / fade out error messages
animateDuration: 300 # fadein/fadout ms time
focus: "first" # 'fist'|'last'|'none' error field to focus after validation
validationMinlength: 3 # Min Length for triggered validation
successClass: "has-success" # Class name on each valid input
@dnszero
dnszero / gist:ba70116663970a828ce9
Created May 10, 2014 00:19
Rails, FactoryGirl, and has_and_belongs_to_many
When testing has_and_belongs_to_many models using rspec and factory girl you should setup your factory the following way:
FactoryGirl.define do
factory :foo do
name "Foo"
end
factory :bar do
name "Bar"
foos { |a| [a.association(:foo)] }