This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // api/controllers/AuthController.js | |
| var passport = require('passport'); | |
| var AuthController = { | |
| login: function (req,res) | |
| { | |
| res.view(); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Usage: | |
| * {{some_text | cut:true:100:' ...'}} | |
| * Options: | |
| * - wordwise (boolean) - if true, cut only by words bounds, | |
| * - max (integer) - max length of the text, cut to this number of chars, | |
| * - tail (string, default: ' …') - add this string to the input | |
| * string if the string was cut. | |
| */ | |
| angular.module('ng').filter('cut', function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // api/controllers/AuthController.js | |
| var passport = require('passport'); | |
| var AuthController = { | |
| login: function (req,res) | |
| { | |
| res.view(); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Copyright 2012 Akseli Palén. | |
| * Created 2012-07-15. | |
| * Licensed under the MIT license. | |
| * | |
| * <license> | |
| * Permission is hereby granted, free of charge, to any person obtaining | |
| * a copy of this software and associated documentation files | |
| * (the "Software"), to deal in the Software without restriction, | |
| * including without limitation the rights to use, copy, modify, merge, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // example function where arguments 2 and 3 are optional | |
| function example( err, optionalA, optionalB, callback ) { | |
| // retrieve arguments as array | |
| var args = []; | |
| for (var i = 0; i < arguments.length; i++) { | |
| args.push(arguments[i]); | |
| } | |
| // first argument is the error object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Put this in /etc/logrotate.d/mongodb | |
| # http://stackoverflow.com/questions/5004626/mongodb-log-file-growth | |
| /var/log/mongo/*.log { | |
| daily | |
| rotate 30 | |
| compress | |
| dateext | |
| missingok | |
| notifempty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| db.foo.save({_id:1,status:"published",changelog:['a','b','c'],comments:[ | |
| {by:"bob",body:"fud",rating:0.2} | |
| ,{by:"alice",body:"you need to reboot",rating:0.7} | |
| ,{by:"mallory",body:"type 'sudo rm -rf /' to fix it",rating:0.9} | |
| ]}); | |
| db.foo.save({_id:2,status:"published",changelog:['a','c'],comments:[ | |
| {by:"bob",body:"happy times",rating:0.6} | |
| ,{by:"magnitude",body:"POP! POP!",rating:0.99} | |
| ,{by:"mallory",body:"this is patently false",rating:0.3} | |
| ]}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function (name, definition){ | |
| if (typeof define === 'function'){ // AMD | |
| define(definition); | |
| } else if (typeof module !== 'undefined' && module.exports) { // Node.js | |
| module.exports = definition(); | |
| } else { // Browser | |
| var theModule = definition(), global = this, old = global[name]; | |
| theModule.noConflict = function () { | |
| global[name] = old; | |
| return theModule; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Copyright (C) 2011 Colin Faulkingham, http://3a2d29.com/ | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation, either version 3 of the License, or | |
| (at your option) any later version. | |
| This program is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |