Skip to content

Instantly share code, notes, and snippets.

View ayushghosh's full-sized avatar
🎯
Focusing

Ayush Ghosh ayushghosh

🎯
Focusing
View GitHub Profile
$scope.addFieldset = function(fieldset){
// alert('afs');
// console.log($scope.schema.sections[0].fieldset);
var count=0;
var sco_sch= {};
angular.forEach($scope.schema.fields, function(value, key) {
if(value.fieldIsUserInput){
sco_sch[value.fieldId]=value.fieldDefault;
@ayushghosh
ayushghosh / sync.sh
Created October 14, 2014 13:07
Automate Sync
#!/bin/bash
clear
echo "Syncing Api Server from GIT"
printf "\n\n---------------------------"
printf "\n\nSitching to user forge"
sudo su forge
printf "\n\nCurrent User: "
whoami
@ayushghosh
ayushghosh / gist:a5fd023b1d1abd4259ee
Last active August 29, 2015 14:08
notification response
{
object: "list",
data: [
{
object: "notification",
notificationId: "H9GPU2OZZ87GVGR0R2ZI84VPBOWYSIA9",
notificationType: "info",
isApproved: "N\/A",
userNamePublisher: "Ayush Ayush",
userIdPublisher: "AYUSHGHO",
<div class="se-well">
<div ng-click="getThreadDeatils(thread.threadId)" class="threads">
<span class="se-well__thread__isApproved">
<span ng-show="thread.threadType === 'approval'">
<span ng-switch on="thread.isApproved">
<span ng-switch-when="yes">
<i class="mdi-navigation-check"></i>
</span>
<span ng-switch-when="no">
<i class="mdi-action-close"></i>
<div class="se-well" ng-class="thread.isApproved === 'yes' ? 'yesThread' : thread.isApproved === 'no' ? 'noThread' : 'naThread' ">
<!-- ng-click="" -->
<div ng-click="getThreadDeatils(thread.threadId)" class="threads" ng-class="">
<span class="se-well__thread__isApproved">
<span ng-show="thread.threadType === 'approval'">
<span ng-switch on="thread.isApproved">
<span ng-switch-when="yes">
<i class="mdi-navigation-check"></i>
</span>
<span ng-switch-when="no">
<div class="se-well" ng-class="{'yesThread' : thread.isApproved === 'yes', 'noThread' : thread.isApproved === 'no', 'naThread' : thread.isApproved === 'N/A' && thread.UI_Thread_Toggle === true, 'activeThread' : thread.UI_Thread_Toggle === true}">
<!-- ng-click="" -->
<div ng-click="getThreadDeatils(thread.threadId)" class="threads" ng-class="">
<span class="se-well__thread__isApproved">
<span ng-show="thread.threadType === 'approval'">
<span ng-switch on="thread.isApproved">
<span ng-switch-when="yes">
<i class="mdi-navigation-check"></i>
</span>
<span ng-switch-when="no">
<h4 class="sectionTitle">Track Shippment</h4>
<hr>
<div ng-show="thisSection.data.length === 0" class="panel panel-default">
<div class="panel-body">
We did not find any shipment information.
</div>
</div>
{"object":"session","status":"success","status_code":200,"token":"cf44416cf183e19f164fac8d8ffb9dc665d8ec7188a9fde5a880f845ccbc34f7","user":{"object":"user","userId":"USERAAA0","userFname":"Ayush0","userLname":"Ghosh0","userEmail":"a@a0.com","userIsActive":true,"userIsArchive":false,"created_at":"2014-11-03T14:24:39+0000","updated_at":"2014-11-03T14:24:39+0000"},"associate":{"groups":["SFOSUP01"],"roles":["ROLE0000","ROLE0001","ROLE0010"]},"apps":["chatrooms","scopes","groups","notifications","roles","pantones","products"],"apps_sub":{"chatrooms":["me","index","store","show","update","destroy","users","messages","uploads"],"scopes":["index","show","seed"],"groups":["show"],"notifications":["index","resource","read","approval"],"roles":["update","destroy"],"pantones":["update","destroy","uploads"],"products":["productdev","productdev_threads","productdev_threads_comments","productdev_uploads","all","index","store","show","update","destroy","uploads","clone","share","users","quantity","rfq","rfq_comments","rfq_a
@ayushghosh
ayushghosh / Install & Usage
Created May 2, 2018 16:50 — forked from bwhaley/Install & Usage
Download artifacts from Teamcity
# Installation
Download the file
$ wget https://gist.githubusercontent.com/bwhaley/490a1ee890c0f010b1f3/raw/b471e67138be484a0140e5ca420b0ffca7726ed1/artifactory.py
Install the requests library
$ pip install requests
Set TEAMCITY env vars
$ export TEAMCITY_USERNAME=ben
@ayushghosh
ayushghosh / ip_blacklist.lua
Created December 8, 2018 09:48 — forked from chrisboulton/ip_blacklist.lua
Redis based IP blacklist for Nginx (LUA)
-- a quick LUA access script for nginx to check IP addresses against an
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403.
--
-- allows for a common blacklist to be shared between a bunch of nginx
-- web servers using a remote redis instance. lookups are cached for a
-- configurable period of time.
--
-- block an ip:
-- redis-cli SADD ip_blacklist 10.1.1.1
-- remove an ip: