Skip to content

Instantly share code, notes, and snippets.

View eleventigers's full-sized avatar

Jokubas Dargis eleventigers

View GitHub Profile
(function() {
var SECTION = "date";
var NOW = "now";
Playtomic.Date = {
now: function(callback) {
sendAPIRequest(SECTION, NOW, dateComplete, callback);
eleventigers / gist:8428111
Last active January 3, 2016 07:18
Found on HN

Note to a PSD web designer

First, PSD's that assume text length. For example, if you have three call-out boxes with a title and some text to follow, don't assume that the title will always be one line and the text will always be the same length. Instead, figure out what this will all look like when you do have very uneven amounts of text. Do we center it vertically? Do we abbreviate it?

Second, PSD's that don't assume a responsive design. Sure, working directly in the medium (HTML/CSS) would solve this, but you can still provide some direction here. Tell me how the columns should be laid out. Which parts of the site should expand/collapse with size, which parts can be hidden, etc.

Third, and this goes without saying, but clean up the PSD layer names and groupings. Layer 1, Layer 2, etc. is not a great convention for this.

Fourth, show me the unusual cases. I know the clients always want to focus on the prominent pages, like the home page, the product listing, etc. Those are impo

eleventigers /
Last active August 29, 2015 13:56
Redis and Rendr

To load sessions into the Rendr app I used connect-redis from visionmedia. Whatever I set on req.session will be stored in a Redis store.

In a custom data-adapter that communicates with our API, I send relevant cookies through the request method. So for example when my data-adapter tries to authenticate with the API on success it should receive a response with sessions cookies set by Deployed. What I do is I save those cookies into req.session and the next time data-adapter does a request I take them out of the cookie jar and put them on top of the request - Deployed links this request with a session on Rendr in this way. Remember that a custom data-adapter can be augmented by any express middleware that comes before it, whether it sets stuff on req.session or else.

This is what I wrote when I needed to pass cookies around, it probably sucks but hey it worked at that time:

   jar = request.jar();


eleventigers /
Created March 14, 2014 10:34
GLTextureView from GLSurfaceView
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGL11;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.egl.EGLSurface;
import javax.microedition.khronos.opengles.GL;
def getPlatformNdkBuildCommand() {
def rootDir = project.rootDir
def localProperties = new File(rootDir, "")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream {
instr -> properties.load(instr)
Copyright (c) 2014 CommonsWare, LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at Unless required
by applicable law or agreed to in writing, software distributed under the
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.
# Convert ANSI (terminal) colours and attributes to HTML
# Licence: LGPLv2
# Author:
# Examples:
# ls -l --color=always | > ls.html
# git show --color | > last_change.html
eleventigers / build.gradle
Created October 24, 2015 13:44
Gradle: suppress SNAPSHOT dependencies caching
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'