Skip to content

Instantly share code, notes, and snippets.

View scizers's full-sized avatar

Ishaan Sharma scizers

View GitHub Profile
@scizers
scizers / nginx.default.conf
Last active August 29, 2015 14:05 — forked from sumardi/nginx.default.conf
Install Nignix for joomla
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php-fpm
# Install PHP extensions
sudo yum install -y php-devel php-mysql php-pdo \
php-pear php-mbstring php-cli php-odbc \
@scizers
scizers / users.js
Last active August 29, 2015 14:03
using recurrsion in node
var createUser = function(userId, callback) {
getLevelIds(userId, function(arr){
console.log(userId , arr , 'test')
userId = arr
callback();
})
}
async.times(2, function(n, next){
createUser(userId, function(err, user) {
@scizers
scizers / decimalOnly.js
Last active August 29, 2015 14:02
Angular Directive to Allow Natural Numbres Only in the input tag
app.directive('decimalOnly', function () {
return {
require: 'ngModel',
link: function (scope, element, attrs, modelCtrl) {
modelCtrl.$parsers.push(function (inputValue) {
if (inputValue == undefined) return ''
console.log(inputValue)
var transformedInput = inputValue.replace(/[^0-9\\.]/g, '');
if (transformedInput != inputValue) {
@scizers
scizers / angular.js
Last active August 29, 2015 14:02
This is a angularjs directive for ensuring unique feilds in form
app.directive('ensureUnique', ['$http', function ($http) {
return {
require: 'ngModel',
link: function (scope, ele, attrs, c) {
scope.$watch(attrs.ngModel, function () {
if(scope[attrs.ngModel] !== undefined) {
$http({
method: 'POST',