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 / gist:5779766
Created June 14, 2013 05:58
JSON as HAML style template
{
"head":
{
"script": {
"attribute": {
"type": "text/javascript",
"src": "http://site/js/application.js"
}
},
"script": {
@llun
llun / gist:5082353
Last active December 14, 2015 11:50
Expect to run success but got error with below result actual expected 1{}
var chai = require('chai'),
sinon = require('sinon'),
sinon_chai = require('sinon-chai'),
chai_as_promised = require('chai-as-promised'),
should = require('chai').should(),
mongoose = require('mongoose'),
q = require('q');
chai.use(sinon_chai);
chai.use(chai_as_promised);
describe("method", function() {
it("should call model with argument", function() {
spyOn(model, 'list').andCallFake(function(page, limit) {
expect(page).toBe(0);
expect(limit).toBe(10);
});
routes.list({ query: { page: 0, limit: 10 }, {});
})
})
Aaron Swartz
We are deeply saddened to hear the news about Aaron Swartz. We extend our heartfelt condolences to Aaron’s family, friends, and everyone who loved, knew, and admired him. He was a truly gifted person who made important contributions to the development of the internet and the web from which we all benefit.
We have had inquiries about JSTOR’s view of this sad event given the charges against Aaron and the trial scheduled for April. The case is one that we ourselves had regretted being drawn into from the outset, since JSTOR’s mission is to foster widespread access to the world’s body of scholarly knowledge. At the same time, as one of the largest archives of scholarly literature in the world, we must be careful stewards of the information entrusted to us by the owners and creators of that content. To that end, Aaron returned the data he had in his possession and JSTOR settled any civil claims we might have had against him in June 2011.
JSTOR is a not-for-profit service and a member of the i
@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 / all.js
Created October 3, 2012 16:26
CORS in Facebook SDK
__d("CORSRequest", ["wrapFunction", "QueryString"], function (a, b, c, d, e, f) {
var g = b('wrapFunction'),
h = b('QueryString');
function i(l, m) {
if (!window.XMLHttpRequest) return null;
var n = new XMLHttpRequest(),
o = function () {};
if ('withCredentials' in n) {
n.open(l, m, true);
@llun
llun / gist:3245558
Created August 3, 2012 07:54
Check empty string speed comparison
var text = '';
var total = 1000000;
var start = new Date().getTime();
for (var index = 0; index < total; index++) {
var isEmpty = /^$/.test(text);
}
var stop = new Date().getTime()