This file contains 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
Force local repo to match git repo | |
----------------------------------------------------- | |
git fetch origin | |
git reset --hard origin/master | |
Remove directories or files from the repo | |
----------------------------------------------------- | |
git rm -r one-of-the-directories | |
git commit -m "Remove duplicated directory" | |
git push origin master |
This file contains 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
Open .profile | |
-------------------------------------------------- | |
nano ~/.profile | |
Create an alias (in profile) | |
-------------------------------------------------- | |
alias new_name='command to be performed' |
This file contains 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
// | |
// jQuery | |
// | |
;(function (window, document, $) { | |
// target all panels | |
var allPanels = $('div.main-links > div.collapse > ul'); | |
$('a.toggle').on('click', function (e) { |
This file contains 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
export CLICOLOR=1 | |
export PATH="/bin:/sbin:/usr/bin:/usr/local/sbin:/Users/nfento/local/lib/node_modules/:/Users/nfento/local/bin/:$PATH" | |
export EDITOR='subl -w' | |
# define colors | |
C_DEFAULT="\[\033[m\]" | |
C_WHITE="\[\033[1m\]" | |
C_BLACK="\[\033[30m\]" | |
C_RED="\[\033[31m\]" |
This file contains 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
/** | |
* check_for_children | |
* | |
* This recursive function retrieves all the sitemap pages, it calls itself | |
* until the children pages for that node are exhausted | |
* | |
*/ | |
function check_for_children( $region_id, $children, $type = 1 ) { | |
if ( count($children) > 0 ) { |
This file contains 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
define( | |
[ 'app', 'services' ], | |
function ( app, services ) { | |
return angular.module('drivecam.services').service('RequestService', | |
['SessionService', '$http', '$resource', '$rootScope', '$cookies', | |
function(SessionService, $http, $resource, $rootScope, $cookies) { | |
/** | |
* @param config {object} - Object which contains all the configuration settings for $http | |
* @return {object} - $http object which success and error methods |
This file contains 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
var fs = require('fs'); | |
var myData = { | |
name:'test', | |
version:'1.0' | |
}, | |
outputFilename = 'my.json'; | |
// Write cache file | |
fs.writeFileSync(outputFilename, JSON.stringify(myData, null, 4)); |
This file contains 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
var fs = require('fs'); | |
var myData = { | |
name:'test', | |
version:'1.0' | |
}, | |
outputFilename = 'my.json'; | |
// Write cache file | |
fs.writeFile(outputFilename, JSON.stringify(myData, null, 4), function(err) { |
This file contains 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
$stateProvider | |
.state('age-gate', { | |
url: '/', | |
templateUrl: 'views/age-gate.html', | |
controller: 'AgeGateCtrl' | |
}) | |
.state('home', { | |
url: '/home', | |
templateUrl: 'views/home.html', |
This file contains 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
<!-- These are the notifications that are displayed to the user through pop-ups if the above JS files does not exist in the same directory--> | |
if ((typeof cordova == 'undefined') && (typeof Cordova == 'undefined')) alert('Cordova variable does not exist. Check that you have included cordova.js correctly'); | |
if (typeof CDV == 'undefined') alert('CDV variable does not exist. Check that you have included cdv-plugin-fb-connect.js correctly'); | |
if (typeof FB == 'undefined') alert('FB variable does not exist. Check that you have included the Facebook JS SDK file.'); | |
FB.Event.subscribe('auth.login', function(response) { | |
alert('auth.login event'); | |
}); | |
FB.Event.subscribe('auth.logout', function(response) { |
OlderNewer