Skip to content

Instantly share code, notes, and snippets.

@shivendra14
shivendra14 / multithread.cpp
Created Sep 14, 2017
A simple multi threaded cpp-11 code
View multithread.cpp
#include <iostream>
#include <string>
#include <vector>
#include <atomic>
#include <thread>
#include <future>
template <class F>
void par_for(int begin, int end, F fn) {
@shivendra14
shivendra14 / RUN_LOG_EMAIL.py
Last active Jul 6, 2018
Python script to run an exe, capture the logs and email them as attachment
View RUN_LOG_EMAIL.py
#
#Revision-1
#Author: Shivendra Agarwal
#Year: 2018
#Title: Python script to run an executable, capture the logs and email them as attachment
#
# Script to run the tests
import subprocess, sys
def IsPlatformWin():
@shivendra14
shivendra14 / Illustrator_Scale_Artboard_and_Artwork.jsx
Last active Aug 14, 2019
Illustrator_Scale_Artboard_and_Artwork
View Illustrator_Scale_Artboard_and_Artwork.jsx
#target Illustrator
var requiredABsize = 1700; //px
var activeDoc = app.activeDocument;
var abActive = activeDoc.artboards[ activeDoc.artboards.getActiveArtboardIndex() ];
var abProps = getArtboardBounds(abActive);
var scale = findRequiredScale(abProps);
if (scale > 1)
View Illustrator_Scale_Artboard_and_Artwork.jsx
#target Illustrator
/*
Revision-1
Author: Shivendra Agarwal
Year: 2017
Title: Script to scale-up artwork and artboard above 15 Mpixel
*/
if ( app.documents.length > 0 )
alert("ERROR: \n Close all documents before running this script." );