Skip to content

Instantly share code, notes, and snippets.

View llun's full-sized avatar
:octocat:

Maythee Anegboonlap llun

:octocat:
View GitHub Profile
AWS_REGION=us-east-1 apex alias -v current staging sampleFunction
⨯ Error: function sampleFunction: ValidationException: 1 validation error detected: Value 'current' at 'functionVersion' failed to satisfy constraint: Member must satisfy regular expression pattern: (\$LATEST|[0-9]+)
status code: 400, request id: f6752c1b-f44e-11e7-a309-bb1a3231a400
AWS_REGION=us-west-2 apex alias -v current staging sampleFunction
• updated alias staging env= function=sampleFunction version=139
@llun
llun / gist:63c7d16c24948d24ee1e
Created March 28, 2016 13:30
Fitbit stack trace
request - n/a - com.fitbit.util.api.ApiException: Error creating JSONObject while responding to API request
at com.fitbit.util.api.ApiSerializerManager.writeAPIResponse(ApiSerializerManager.java:361)
at com.fitbit.stripes.resolution.SmartResolution.returnApiOutput(SmartResolution.java:114)
at com.fitbit.stripes.resolution.SmartResolution.execute(SmartResolution.java:98)
at net.sourceforge.stripes.controller.DispatcherHelper$7.intercept(DispatcherHelper.java:497)
at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158)
at com.fitbit.stripes.ResolutionMonitoringInterceptor.intercept(ResolutionMonitoringInterceptor.java:29)
at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
at net.sourceforge.stripes.controller.HttpCacheInterceptor.intercept(HttpCacheInterceptor.java:99)
at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
@llun
llun / image-processing-services.md
Last active October 14, 2015 07:05 — forked from cheeaun/image-processing-services.md
3rd-party image processing/manipulation services
@llun
llun / fitbit.request.sh
Created September 11, 2015 03:16
A fitbit request hack
curl -H "Host: iphone-api.fitbit.com" -H "Accept-Locale: en_US" -H "Accept: */*" -H "Authorization: OAuth oauth_consumer_key="lmsg3wj8pjz532bhjhq0ymsi3w1z7gqs", oauth_nonce="174Oizg%2BRsyJSvY4vhxQVw%3D%3D", oauth_signature="WEwrW3%2FeoLCP3y%2FgCaHT0zgjerE%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1441887597", oauth_token="e74cb5c81c165804cc607be10f14c287", oauth_version="1.0"" -H "Proxy-Connection: keep-alive" -H "Accept-Language: METRIC" -H "User-Agent: FitbitMobile/2.13.2 (iPad; iOS 8.4.1; Scale/2.00)" -H "X-App-Version: 412" --data "activityTypeId=90009&details=%7B%22trackpoints%22%3A%5B%7B%22verticalAccuracy%22%3A10%2C%22interpolated%22%3Atrue%2C%22horizontalAccuracy%22%3A65%2C%22longitude%22%3A103.8869949949695%2C%22elevation%22%3A32.65422058105469%2C%22date%22%3A%222015-09-10T20%3A19%3A06.486%2B08%3A00%22%2C%22latitude%22%3A1.324899059130756%7D%2C%7B%22verticalAccuracy%22%3A10%2C%22horizontalAccuracy%22%3A65%2C%22elevation%22%3A32.65422058105469%2C%22latitude%22%3A1.324899059130756%2C%22
@llun
llun / gulpfile.js
Created March 13, 2015 06:23
Jasmine ES6
var gulp = require('gulp')
, jasmine = require('gulp-jasmine')
gulp.task('default', function() {
require('babel/register');
return gulp.src('test.js').pipe(jasmine())
});
@llun
llun / helper1.js
Created March 10, 2015 14:37
Ember.js helper
Ember.Handlebars.registerHelper('helperName', function(param1, param2, options) {
return "HTML output for this helper"
})
@llun
llun / in.js
Created February 15, 2015 01:18
generated from 6to5
let obj = [1, 2, 3]
for (let val of obj) {
console.log (val)
}
@llun
llun / toc.js
Created October 21, 2014 03:18
Create TOC from Github markdown page
var toc = '';
for (var i = 0; i < contents.length; i++) { var link = contents[i].querySelector('a').getAttribute('href'); var text = contents[i].textContent.replace(/^\s+|\s+$/,''); toc += '- [' + text + '](' + link + ')\n' }
console.log (toc);
@llun
llun / .profile
Last active August 29, 2015 14:04
Shell alias for Docker
docker_get_name_from_image() {
echo $@ | sed "s/\//./"
}
docker_remove_exists_name() {
local name=`docker_get_name_from_image $2`
local exists=`sudo docker ps -a | grep $name | awk '{ print $1 }'`
if [ -n "$exists" ]; then
sudo docker rm $name > /dev/null 2>&1
fi