// jQuery
$(document).ready(function() {
// code
})
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
diff --git a/src/app/secure/profile/myprofile.component.ts b/src/app/secure/profile/myprofile.component.ts | |
index cd3f9b2..d72c6fb 100644 | |
--- a/src/app/secure/profile/myprofile.component.ts | |
+++ b/src/app/secure/profile/myprofile.component.ts | |
@@ -1,5 +1,5 @@ | |
import {Component} from "@angular/core"; | |
-import {LoggedInCallback, UserLoginService, UserParametersService, Callback} from "../../service/cognito.service"; | |
+import {LoggedInCallback, UserLoginService, CognitoUtil, UserParametersService, Callback} from "../../service/cognito.service"; | |
import {Router} from "@angular/router"; | |
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
git checkout -b oldroot X | |
TREE=`git write-tree` | |
COMMIT=`echo "Killed history" | git commit-tree "$TREE"` | |
git checkout -b newroot "$COMMIT" | |
git rebase --onto newroot oldroot master | |
# repeat for other branches than master that should use the new initial commit | |
git checkout master | |
git branch -D oldroot | |
git branch -D newroot | |
git gc # WARNING: if everything's done right, this will actually delete your history from the repo! |
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
var request = require('request'); | |
var mysql = require('mysql'); | |
var async = require('async'); | |
var cheerio = require('cheerio'); | |
var _ = require('lodash'); | |
var domain = 'http://timesofindia.indiatimes.com/'; | |
function getDomain() { |
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
alias nginx.start='sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist' | |
alias nginx.stop='sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist' | |
alias nginx.restart='nginx.stop && nginx.start' | |
alias php-fpm.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist" | |
alias php-fpm.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plist" | |
alias php-fpm.restart='php-fpm.stop && php-fpm.start' | |
alias mysql.start="launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" | |
alias mysql.stop="launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist" | |
alias mysql.restart='mysql.stop && mysql.start' | |
alias nginx.logs.error='tail -250f /usr/local/etc/nginx/logs/error.log' |
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
sql = sql.replace(/,\s*$/, ""); |
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
/*** | |
* This gist provides a __FILE__ variable, which holds the path to the file | |
* from which the currently running source is being executed. | |
* | |
* Usage example: alert(__FILE__); | |
* | |
* Thanks to http://ejohn.org/blog/__file__-in-javascript/ on which this gist | |
* is based on. | |
* | |
* Tested in Mozilla Firefox 9, Mozilla Firefox 16, Opera 12, Chromium 18 |
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
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
//Database connection | |
var uristring = 'mongodb://localhost/test'; | |
var mongoOptions = { }; | |
mongoose.connect(uristring, mongoOptions, function (err, res) { | |
if (err) { | |
console.log('Error when connecting to: ' + uristring + '. ' + err); |
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
String.prototype.regexIndexOf = function(regex, startpos) { | |
var indexOf = this.substring(startpos || 0).search(regex); | |
return (indexOf >= 0) ? (indexOf + (startpos || 0)) : indexOf; | |
} | |
String.prototype.regexLastIndexOf = function(regex, startpos) { | |
regex = (regex.global) ? regex : new RegExp(regex.source, "g" + (regex.ignoreCase ? "i" : "") + (regex.multiLine ? "m" : "")); | |
if(typeof (startpos) == "undefined") { | |
startpos = this.length; | |
} else if(startpos < 0) { | |
startpos = 0; |
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
chmod -R u+rwX,go+rX,go-w /foo |