Skip to content

Instantly share code, notes, and snippets.

@xasima
xasima / Install goog-closure-linter on Ubuntu
Created February 8, 2012 16:34
Installing google closure linter (with easy_install) on Ubuntu 11.10
sudo apt-get install build-essential
sudo apt-get install python-cheetah
wget http://peak.telecommunity.com/dist/ez_setup.py
sudo python ez_setup.py
sudo easy_install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz
>> Installing fixjsstyle script to /usr/local/bin
Installing gjslint script to /usr/local/bin
@xasima
xasima / 3-typography.css
Created April 8, 2013 17:02
Declare closure-stylesheet mixins (3-typography.gss) and try to use them (in 5-main.gss)
/* Typograph Vertical Rythms via http://drewish.com/tools/vertical-rhythm
Initial params:
Georgia - base font-family,
15px - base font,
22.5 - line height ,
40, 35, 30 20 15 13 - target fonts rythms
--------------------*/
@def _FNT_SIZE 15;
@def _EM _FNT_SIZE;
@xasima
xasima / gist:7825313
Last active December 30, 2015 11:49
The log of testing the `grunt server` command when using yoman's generator-closure
weblab@devbox:~/projects$ grunt --version
grunt-cli v0.1.11
weblab@devbox:~/projects$ yo --version
1.0.4
weblab@devbox:~/projects/closure-test$ node --version
v0.8.26
weblab@devbox:~/projects/closure-test$ npm --version
@xasima
xasima / build.gradle
Created January 19, 2015 21:27
Gradle file with multidex, scala, android-annotations
// ----------- Build script configuration
buildscript {
repositories {
mavenCentral()
maven { url 'http://saturday06.github.io/gradle-android-scala-plugin/repository/snapshot' }
maven { url 'http://clinker.47deg.com/nexus/content/groups/public' }
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
maven { url 'https://maven.fabric.io/public' }
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
@xasima
xasima / aurora-configuration-issue.md
Last active August 29, 2015 14:15
aurora configuration issue

Mesos Master and Slave status

> lsb_release -a | grep Description
Description:	Ubuntu 12.04.4 LTS

> sudo lsof -i :2181 | grep '(LISTEN)'
java      29720 zookeeper   27u  IPv4 236483534      0t0  TCP *:2181 (LISTEN)

> mesos-master --version
@xasima
xasima / gist:56e5fe7c841199475f5c
Last active August 29, 2015 14:20
finagle-finch with argonaut-json implicit conversion
// These are snippets based on the recent finch demo package.
// Some modification are added to eliminate usage of ToJson trait,
// but use argonaut Json via implicits instead.
// The purpose of ToJson trait removal is to bypass compilers errors on
// Service[AuthRequest, Seq[argonaut.Json]] to Service[AuthRequest, Json]]
// conversion.
// See current compilers errors at the bottom of the gist
@xasima
xasima / ETag.scala
Created May 2, 2015 19:56
Thrift, json, and scrooge scala to test scrooge(thrift) - argounaut(json) bijection
/**
* Generated by Scrooge
* version: 3.14.1
* rev: a996c1128a032845c508102d62e65fc0aa7a5f41
* built at: 20140501-114707
*/
package com.xxx.services
import com.twitter.scrooge.{
TFieldBlob, ThriftException, ThriftStruct, ThriftStructCodec3, ThriftStructFieldInfo, ThriftUtil}
@xasima
xasima / model.scala
Last active August 29, 2015 14:21
Finch usage to transfer custom headers
// Let change finch example to specify custom http-headers (let call them CTPPHeader) per models
object model {
trait ToJsonWithHeaders {
def toJson: Json
// provide specific headers per model file
def getTemplate :String
}
@xasima
xasima / RestFinchServer.scala
Created July 17, 2016 21:25
circe in finch question
import com.twitter.app.Flag
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finagle.{Http, ListeningServer, Service}
import com.twitter.server.TwitterServer
import com.twitter.util.Await
import io.circe.{Encoder, Json}
import io.finch._
import io.finch.circe._
// OSX
open /Applications/Google\ Chrome.app --args --disable-web-security --user-data-dir
// Linux
chromium-browser --disable-web-security --user-data-dir
// Windows
// (Needs to find where is Chrome Link: may just right click on Chrome icon and choose its properties and path)
// later
cd /D C:/UserData/Microsoft/Windows/...