Skip to content

Instantly share code, notes, and snippets.

View skellertor's full-sized avatar
🫡

Samuela Keller skellertor

🫡
View GitHub Profile
@skellertor
skellertor / custom_gulp_tasks.md
Last active October 18, 2015 08:45
Custom gulp tasks

Gulp task to replace the src attribute of an html script element so the browser doesn't cache it.

var replace = require('gulp-replace');

function cache_version() {
    return (Math.floor((Math.random() * 1000) + 1)).toString(); 
}

gulp.task('version', function () {
@skellertor
skellertor / any_subfolder.md
Created October 18, 2015 18:13
gulp syntax for any subfolder
gulp.src('src/**/*.js);
@skellertor
skellertor / how_to.md
Last active October 22, 2015 14:37
Using jsTestDriver.js and jasmine.js to test angular

Context

  • You are currently using jsTestDriver as your test runner and assert engine for all vanilla javascript objects. In order to test angular controllers we use jasmine.js version 1.3. Jasmine is another testing framework that sits on top of jsTestDriver. All jasmine versions past 2.0 seem to break some other dependencies such as angular-mocks.js.
  • The order of the includes in the configuration file matters! jasmine.js and JasmineAdapter.js must be before angular.js and angular-mocks.js.
  • The angular controller test cases must be declared after angular and angular mocks.
  • All angular controller tests use jsTestDriver as the test runner, and jasmine as the assert engine.

Adding Angular Controllers to test suite

  • Open up jsTestDriver.conf or javascript_testing_config.jstd. Both are YAML-like configuration files and can be used interchangeably.
@skellertor
skellertor / sublime-build.md
Created October 29, 2015 23:01
Creating custom build files for sublime

Start

@skellertor
skellertor / install-mongodb.md
Created November 25, 2015 22:11 — forked from adamgibbons/install-mongodb.md
Install MongoDB on Mac OS X 10.9

Install MongoDB with Homebrew

brew install mongodb
mkdir -p /data/db

Set permissions for the data directory

Ensure that user account running mongod has correct permissions for the directory:

@skellertor
skellertor / osx-mongodb-rlimits-fix.md
Created November 26, 2015 00:48 — forked from tamitutor/osx-mongodb-rlimits-fix.md
Fix Mongodb "soft rlimits" Warning On Mac OS X (Yosemite)

If you are seeing Mongo soft rlimits warnings in your logs, or a WARNING: soft rlimits too low. Number of files is 256, should be at least 1000 when you login to mongo shell via mongo from the commandline, or any mysterious/unexplained mongo connection errors... follow this how-to exactly and it will resolve the issue for you.

(Source of this how to found at basho/basho_docs#1402)

First file: sudo vi /Library/LaunchDaemons/limit.maxfiles.plist

...containing:

@skellertor
skellertor / spacers.md
Last active January 23, 2017 21:22
Adding spacers in mac dock
  1. Open command line interface
  2. Type defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
  3. Type killall Dock

ctrl + command + j

#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
# Delete every Docker containers
# Must be run first because images are attached to containers
docker rm $(docker ps -a -q)
# Delete every Docker image
docker rmi $(docker images -q)