Skip to content

Instantly share code, notes, and snippets.

View kbshl's full-sized avatar

Konstantin Büschel kbshl

  • Marburg, Hessen, Deutschland
  • 13:39 (UTC +02:00)
  • X @iskostja
View GitHub Profile
@kbshl
kbshl / add_code_to_empty_repo.sh
Created October 19, 2016 13:11
Bitbucket Cloud - Add an existing, unversioned code to an empty repository
# From your terminal, change to the root directory of your existing code.
# Initialize the directory under source control from the following command:
git init
# Add the existing files to the repository you have initialized:
git add .
# Commit the files:
git commit -m 'initial commit of full repository'
@kbshl
kbshl / remove_falsy_object_props.js
Created October 10, 2016 06:47
Remove empty properties falsy values from object with Underscore >= 1.7.0 or Lodash From http://stackoverflow.com/questions/14058193/remove-empty-properties-falsy-values-from-object-with-underscore-js
var cleanedObj;
// Underscore >= 1.7.0
cleanedObj = _.pick(sourceObj, _.identity);
// Lodash >= 0.1.0
cleanedObj = _.pick(sourceObj, _.identity);
// Lodash >= 4.0.0
cleanedObj = _.pickBy(sourceObj);
@kbshl
kbshl / el_capitan_gem_install_rootless.sh
Created August 2, 2016 12:37
Solution El Capitan Error (errnoeperm operation not permitted) while executing gem - From http://stackoverflow.com/questions/32891965/error-while-executing-gem-errnoeperm-operation-not-permitted
# Apparently with OSX el Capitan, there is a new security function that prevents
# you from modifying system files called Rootless.
# So you'll have 2 options: If you install gems on "/usr/local/bin"
# there will be no problem because rootless doesn't affect this path.
sudo gem install -n /usr/local/bin GEM_NAME_HERE
@kbshl
kbshl / migration_file_timestamp.js
Created July 11, 2016 10:23
Create Appcelerator Alloy Migration File Timestamp from MomentJS
console.log(moment().format('YYYYMMDDHHmmss_'));
@kbshl
kbshl / alloy_module_tag.xml
Created June 6, 2016 09:15
Appcelerator Alloy Module Tag in Action
<!-- Example:
<Module id="paint" module="ti.paint" method="createPaintView" eraseMode="false" strokeWidth="1.0" strokeColor="red" strokeAlpha="100" />
-->
<Module module="" method="" id="" />
# Add the remote, call it "upstream":
git remote add upstream https://github.com/whoever/whatever.git
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:
git fetch upstream
# Make sure that you're on your master branch:
# Add the remote, call it "upstream":
git remote add upstream https://github.com/whoever/whatever.git
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:
git fetch upstream
# Make sure that you're on your master branch:
# //FIRST_SELECTOR/SECOND_SELECTOR[text()='SEARCH_WORD']
# example:
/DocText/WithQuads/Page/Word[text()='July']
# //FIRST_SELECTOR/following-sibling::SECOND_SELECTOR
# example:
//tr[td=' Color Digest '][2]/td/following-sibling::td[1]