Skip to content

Instantly share code, notes, and snippets.

@tomyam1
tomyam1 / lambda.conf
Created October 26, 2020 09:20 — forked from lukewaite/lambda.conf
logstash_cloudwatch_logs_lambda
input {
cloudwatch_logs {
log_group => "/aws/lambda/my-lambda"
access_key_id => "AKIAXXXXXX"
secret_access_key => "SECRET"
type => "lambda"
}
}
filter {
@tomyam1
tomyam1 / async.function.decorator.js
Created May 24, 2020 22:21 — forked from gskachkov/async.function.decorator.js
Decorator for async function in angular
import decoratorHelper from 'decorator.helper';
// Current decorator allow async function to be used in angular
// without adding unnecessary digest calls
const ngAync = function () {
return function (target, key, descriptor) {
const fn = descriptor.value;
descriptor.value = function () {
const result = fn.apply(this, arguments);
@tomyam1
tomyam1 / logstash-emitter.conf
Created September 5, 2018 08:04 — forked from evilchili/logstash-emitter.conf
logstash emitter config for jenkins server logs
input {
file {
path => "/var/log/jenkins/*"
type => "jenkins-server"
start_position => "beginning"
}
}
# The first filter munges the logs into discrete events.
filter {
@tomyam1
tomyam1 / include.md
Created August 20, 2017 15:42
Update Serverless Package

Update includes in serverless.yml

Determine which modules are needed to be included:

On Windows with cygwin:

npm ls --production | grep -i '\-\-' | sed 's/.*-- \(.*\)@.*/- node_modules\\/\1\\/**/g'

You'll get an output like

@tomyam1
tomyam1 / lodash.custom.js
Last active June 30, 2016 17:08
lodash-issue
/**
* @license
* lodash (Custom Build) <https://lodash.com/>
* Build: `lodash core --development plus="add,assign,capitalize,cloneDeep,deburr,findIndex,forIn,intersection,isError,isPlainObject,merge,method,pickBy,property,range,remove,times,uniq,values,String,maxBy,isNil,chunk"`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
;(function() {
@tomyam1
tomyam1 / lodash.custom.js
Last active June 30, 2016 17:06
lodash-cli issue
/**
* @license
* lodash 4.11.1 (Custom Build) <https://lodash.com/>
* Build: `lodash core --development plus="add,assign,capitalize,cloneDeep,deburr,findIndex,forIn,intersection,isError,isPlainObject,merge,method,pickBy,property,range,remove,times,uniq,values,String,maxBy,isNil,chunk"`
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
;(function() {
@tomyam1
tomyam1 / logz.io.js
Last active March 4, 2016 14:36
Data extraction scripts
// Prints the s3 buckets defiend as log sources in a tab delimited format you can paste in excel
// https://app.logz.io/#/dashboard/data-sources/
var settings = [];
$('.s3-settings-section').each(function() {
var sectionEl = $(this);
var bucket = sectionEl.find('[ng-model="settings.bucket"]').val();
var prefix = sectionEl.find('[ng-model="settings.prefix"]').val();
settings.push(bucket + '\t' + prefix);
});
@tomyam1
tomyam1 / .gitignore
Created December 3, 2015 17:46 — forked from mathiasbynens/.gitignore
Generating a regular expression to match valid JavaScript identifiers (like https://mathiasbynens.be/demo/javascript-identifier-regex) in Node.js
node_modules
@tomyam1
tomyam1 / readme.md
Created August 30, 2015 10:48
Build and run iText RUPS

How to build and run iText RUPS

svn checkout svn://svn.code.sf.net/p/itextrups/code/tags/rups-5.5.6 itextrups-code
cd itextrups-code
mvn package
java -jar target/itext-rups-5.5.6-jar-with-dependencies.jar

Source: comment by lilalinda on http://sourceforge.net/projects/itextrups/

@tomyam1
tomyam1 / matchers.js
Last active April 9, 2020 15:02
Custom matchers for Protractor and Jasmine 2
'use strict';
const _ = require('lodash');
const Tinycolor2 = require('tinycolor2');
/**
* Custom matchers for protractor and jasmine 2
*
* expect(el).toBePresent();
* expect(el).toBeDisplayed();