A Pen by Navneet Kumar on CodePen.
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
sed -i -e 's/<ACCOUNTID>/1234/g' aws-provision-cf.json | |
sed -i -e 's/<BUCKETNAME>/nexus-test/g' aws-provision-cf.json | |
sed -i -e 's/<REGION>/us-east-1/g' deployment/aws-provision-cf.json | |
aws --profile admin cloudformation create-stack --stack-name polarisInfra --template-body file:///aws-provision-cf.json --capabilities CAPABILITY_NAMED_IAM |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Stack to create Infra resources for polaris", | |
"Parameters": { | |
"BucketName": { | |
"Description": "Deployment S3 Bucket is where project is deployed after mvn deploy command.", | |
"Type": "String", | |
"MinLength": "3", | |
"MaxLength": "63", | |
"Default": "<BUCKETNAME>" |
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
public class Handler implements RequestStreamHandler { | |
static final Logger logger = Logger.getLogger(Handler.class); | |
public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) | |
throws IOException { | |
try { | |
Properties props = new Properties(); | |
props.load(Thread.currentThread().getContextClassLoader().getResource("lambda.properties").openStream()); | |
String runnableClass = props.getProperty("deployment.lambdaRunnabe"); |
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
alert("Executing from script"); | |
alert("updating script"); | |
alert("new"); | |
ok |
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
//Use underscore library(http://underscorejs.org) for sample codes below | |
//Memoize a long running function | |
var optimized_function = _.memoize(function(n) { | |
//Code for a long running task | |
}); | |
//Function throttling to avoid multiple execution | |
var wait_time = 100 //in ms | |
var throttled_function = _.throttle(updatePosition, wait_time); |
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
app = {} | |
app.cacheManager = function() { | |
var self = {}; | |
var namedSpacedKey = function(key) { | |
if(app.release.version && app.release.version != "") return app.release.version + "." + key; | |
else return key; | |
}; |
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
//avoid zombie objects | |
app.views.home = app.views.home || new app.views.Home() | |
//Use queue for executing long-running tasks | |
var queue = async.queue(function (task, callback) { | |
console.log('started ' + task.name); | |
callback(); | |
}, 2); |
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
function loadFile(url) { | |
var script = document.createElement('SCRIPT'); | |
script.src = url | |
document.getElementsByTagName('HEAD')[0].appendChild(script); | |
} |
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
require 'timeout' | |
namespace :android do | |
DEPLOYABLES_ANDROID_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'deployables', 'android')) | |
IBA_ANDROID_PKG = 'br.com.iba.readers' | |
ASSETS_RUNTIME = "/data/data/#{IBA_ANDROID_PKG}/#{IBA_ANDROID_PKG}/Local\\ Store/assets_runtime/htmlresources/buttons" | |
desc 'Runs the automated testing for Android' | |
task :ci => |
NewerOlder