Skip to content

Instantly share code, notes, and snippets.

View prayagupa's full-sized avatar
💭
Neta

Prayag prayagupa

💭
Neta
View GitHub Profile
@jmaicher
jmaicher / Database.scala
Last active December 27, 2015 16:49
Problem with play 2.2.1 and play-slick 0.5.0.8 when using the cake pattern as seen in the computer-database sample.
package lib.data
import play.api.db.slick.Config.driver.simple._
// Inspired by: http://bit.ly/HL0y7u
private[data] trait DAO extends ReviewersComponent with ProposalsComponent with ValuationsComponent {
val Reviewers = new Reviewers
val Proposals = new Proposals
val Valuations = new Valuations
}
@drewr
drewr / import-bulks
Last active December 26, 2015 23:59
Simple bulk-indexing
#!/bin/sh
index=$1
find . -name \*.bulk.gz | while read i; do
gzip -cd $i | curl -XPOST localhost:9200/${index}/_bulk -d@- >/dev/null
done
@thcipriani
thcipriani / baller_motd.md
Last active February 12, 2023 12:28
Using img2ponysay to create baller /etc/motd message

Update: I made this a proper blog post

Creating Baller/Useful MOTD Messages

Zangief MOTD

Prerequisites

  • linux box
@BennettSmith
BennettSmith / ..build-protbuf-2.5.0.md
Last active November 26, 2024 06:50
Script used to build Google Protobuf 2.5.0 for use with Xcode 5 / iOS 7. Builds all supported architectures and produces a universal binary static library.

Google Protobuf 2.5.0 - Mac OS X and iOS Support

The script in this gist will help you buid the Google Protobuf library for use with Mac OS X and iOS. Other methods (such as homebrew or direct compilation) have issues that prevent their use. The libraries built by this script are universal and support all iOS device architectures including the simluator.

Get the Script

The easiest way to use this script is to simply clone the gist onto your

@pixelhandler
pixelhandler / ember-rails-scaffold.md
Last active August 20, 2021 23:06
Scaffold for a browser app build with Ember.js, Rails, Ember.Data

Scaffold for a browser app build with Ember.js, Rails, Ember.Data

Journal App

This is a scaffold for setting up: an API with Rails and the ember-rails gem, persistence with Ember.Data, and a browser app using Ember.js

See source code on GitHub: pixelhandler/journal.

@jroper
jroper / With Grzegorz's improvements
Last active December 21, 2015 22:19
Scala incremental compiler improvements by Grzegorz Kossakowski. Actual runtimes are not so important here, since the two benchmarks were run on different machines, and also they make no attempt to ensure that the scala compiler is fully JITed, which during normal Play development offers significant improvements over these times as the compiler …
Initial clean compile of entire project:
[info] [info] Compiling 29 Scala sources and 1 Java source to /tmp/inc-compile/target/scala-2.10/classes...
[info] [success] Total time: 15 s, completed Aug 28, 2013 9:43:38 PM
Now simulate adding a method to a controller:
[info] [info] Compiling 1 Scala source to /tmp/inc-compile/target/scala-2.10/classes...
[info] [success] Total time: 2 s, completed Aug 28, 2013 9:43:40 PM
Now simulate adding a new route to the routes file:
[info] [info] Compiling 2 Scala sources and 1 Java source to /tmp/inc-compile/target/scala-2.10/classes...
@ondrej-kvasnovsky
ondrej-kvasnovsky / _Events.groovy
Last active December 21, 2015 02:59
Grails and Logback: Provide default logback configuration for development environment
import ch.qos.logback.classic.Level
import ch.qos.logback.classic.Logger
import ch.qos.logback.classic.LoggerContext
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import ch.qos.logback.classic.joran.JoranConfigurator
import ch.qos.logback.core.ConsoleAppender
import grails.util.Environment
import org.apache.commons.logging.Log
import org.apache.commons.logging.LogFactory
import org.slf4j.LoggerFactory;
@alexkingorg
alexkingorg / .gitconfig
Last active December 21, 2015 02:38
Some gitconfig aliases. #git
[alias]
up = "pull --rebase"
pullmerge = "pull --no-rebase"
subup = "!f() { git submodule sync; git submodule update --init --recursive; }; f"
subreset = "submodule foreach 'git reset --hard HEAD'"
who = shortlog -s --
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
info = remote -v
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
@chritchens
chritchens / simple-elasticgo.go
Created August 14, 2013 14:24
Just a simple example on using elastigo, a Go driver for Elasticsearch. It's also an occasion to play with the encode/json package. In this case the docs are Couchbase documents indexed by Elasticsearch through the official river plugin. The type of the docs, `couchbaseDocuments`, is automatically set by the plugin. Plugin page: http://www.couch…
package main
import "fmt"
import "log"
import "encoding/json"
import "time"
import "github.com/mattbaird/elastigo/api"
import "github.com/mattbaird/elastigo/core"
type Person struct {
anonymous
anonymous / gist:6109593
Created July 30, 2013 02:01
echo "Deleting old ElasticSearch index..."
curl -XDELETE 'localhost:9200/arrtest'
echo "Creating new ElasticSearch index..."
curl -XPUT 'localhost:9200/arrtest/?pretty=1' -d '
{
"mappings" : {
"cust2" : {
"properties" : {
"firstName" : {