Skip to content

Instantly share code, notes, and snippets.

Chintan Tank tankchintan

  • SnagFilms
  • New York
View GitHub Profile
@tankchintan
tankchintan / traverseFolders.js
Created May 6, 2020
Quick & dirsty Google App Script for traversing folder & printing out the info to a spreadsheet.
View traverseFolders.js
function main() {
const folderName = "Out"; // Name of the root folder, assume unique folder name for digging
const maxDepth = 3; // How deep you want to go
const folder = DriveApp.getFoldersByName(folderName).next();
const spreadsheetName = folder + ": Folder Contents : " + new Date(); // Creates NEW spreadsheet with format: "SomePics: Folder Contents : 2020 May 5 4:53 PM"
const spreadsheetFile = SpreadsheetApp.create(spreadsheetName);
const sheet = spreadsheetFile.getActiveSheet();
sheet.appendRow(["File Name", "Folder Name", "Link"]);
@tankchintan
tankchintan / get-mio-logs.sh
Created Mar 22, 2016
Fetch MIO server logs.
View get-mio-logs.sh
log_destination_dir=$3
cluster=$1
node_index_start=$2
nodex_index_next=$(($node_index_start+1))
node_type=( master job index )
node_indices=( $node_index_start $nodex_index_next )
fetched_files=( )
for current_node_type in "${node_type[@]}"; do
@tankchintan
tankchintan / prestitial.less
Created May 8, 2015
dfp > prestitial oop solution > style
View prestitial.less
@import '../libs/prefixer.less';
@min-z-index: 10000001;
.no-scroll {
overflow: hidden;
}
#prestitial-ad-overlay {
position: fixed;
@tankchintan
tankchintan / prestitial.js
Created May 8, 2015
dfp > prestitial oop solution > prestitial javascript
View prestitial.js
var DfpOutOfPageAdGenerator = DfpOutOfPageAdGenerator || {};
DfpOutOfPageAdGenerator.Prestitial = Class.extend({
properties: {
isAdSkippedManually: false,
dfpCreativeMarkup: undefined,
dfpCreativeParameters: undefined
},
@tankchintan
tankchintan / dfp-prestitial-ad.html
Created May 8, 2015
dfp > prestitial oop solution > markup shell
View dfp-prestitial-ad.html
<link rel="stylesheet" href="/css/dfp/interstitial.css" />
<script src="/js/dfp/prestitial.js"></script>
<div id="prestitial-ad-outer-container">
<div id="prestitial-ad-overlay"></div>
<div id="prestitial-ad-close">Click to Skip Ad</div>
<div id="prestitial-ad-duration-counter"><em>Closing in...</em></div>
<div id="prestitial-ad-logo"></div>
<div id="prestitial-ad-container"></div>
<div id="prestitial-ad-third-party-content-view-tracker"></div>
@tankchintan
tankchintan / DumpDepositoryStructureInToSourceSetsAndSources
Created Dec 28, 2011
code to dump depositorystructure into sourcesets and sources tables
View DumpDepositoryStructureInToSourceSetsAndSources
Hi Meena..............
//Method to dump depositorystructure into sourcesets and sources tables
public String dumpDepositoryStructureInToSourceSetsAndSources() {
//Get all active depositories
for (Depository depository : depositoryDAO.getAll()) {
int count = 1;
View RecentLoginHistoryAction.java
// this is already existing code
for (Memberloginhistory memberloginhistoryFromDB : memberLoginHistoryListFromDB) {
parsedBrowserDetails = memberloginhistoryFromDB.getBrowserdetails();
parsedBrowserDetails = UserAgentUtil.getBrowser(parsedBrowserDetails)[2] + " on "
+ UserAgentUtil.getOS(parsedBrowserDetails)[1];
Member member = memberBO.getById(memberloginhistoryFromDB.getMember().getId());
// Memberloginhistory object values have to retrive in jsp.
@tankchintan
tankchintan / java-sdk-version-changer.sh
Created Nov 11, 2011
Activation and Definition of shell script that changes Java SDK to be Sun JDK if it is OpenJSK
View java-sdk-version-changer.sh
# To be put in /etc/rc.d/rc.local
bash /home/ec2-user/misc/java-version-changer.sh >> /home/ec2-user/misc/java-change.log 2>&1
# Contents of java-version-changer.sh that detects if openJDK is installed, if true first it will
# install sun jdl & then set it as the default Java SDK
dd="`date +%Y_%m_%d__%H_%M_%S`"
if [ `ls -l /etc/alternatives/java | grep openjdk | wc -l` -eq 1 ]; then
echo "$dd - Open JDK"
sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_01/bin/java 20000
sudo /usr/sbin/alternatives --set java /usr/java/jdk1.7.0_01/bin/java
View gist:1338374
SELECT sourceid, url, COUNT( * )
FROM source s
GROUP BY sourceid
ORDER BY COUNT( * ) DESC , url ASC
LIMIT 10000
View gist:1338194
JAVA_HOME=<java location>
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
You can’t perform that action at this time.