Skip to content

Instantly share code, notes, and snippets.

View therealcisse's full-sized avatar

Amadou Cisse therealcisse

View GitHub Profile
CREATE TEXT SEARCH CONFIGURATION fr ( COPY = french );
ALTER TEXT SEARCH CONFIGURATION fr ALTER MAPPING
FOR hword, hword_part, word WITH unaccent, french_stem;
CREATE TEXT SEARCH CONFIGURATION en ( COPY = english );
ALTER TEXT SEARCH CONFIGURATION en ALTER MAPPING
FOR hword, hword_part, word WITH unaccent, english_stem;
CREATE TEXT SEARCH CONFIGURATION de ( COPY = german );
ALTER TEXT SEARCH CONFIGURATION de ALTER MAPPING

Installation

1)

brew install nginx
sudo cp /usr/local/Cellar/nginx/1.8.0/homebrew.mxcl.nginx.plist /Library/LaunchAgents

2)

Replace /usr/local/etc/nginx/nginx.conf with the nginx.conf in this gist. I'm using port 5000 for my current project. Obviously, change server_name as well, and probably the name of its access log.

@therealcisse
therealcisse / carbon-cache@i.service
Created March 8, 2017 00:27 — forked from joemiller/carbon-cache@i.service
leveraging systemd instantiated units for graphite carbon-cache instances
[Unit]
Description=carbon-cache instance %i (graphite)
[Service]
User=graphite
Group=graphite
ExecStartPre=/bin/rm -f /opt/graphite/storage/carbon-cache-%i.pid
ExecStart=/opt/graphite/bin/carbon-cache.py --instance=%i start
Type=forking
PIDFile=/opt/graphite/storage/carbon-cache-%i.pid
@therealcisse
therealcisse / TestMultipartFileUpload.scala
Created January 16, 2018 21:59 — forked from jrudolph/TestMultipartFileUpload.scala
akka-http Multipart file-upload client + server example
package akka.http.scaladsl
import java.io.File
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.util.ByteString
import scala.concurrent.duration._
import akka.actor.ActorSystem
@therealcisse
therealcisse / README.md
Created July 11, 2018 00:58 — forked from pathikrit/README.md
My highly opinionated list of things needed to build an app in Scala

Restoo

Restaurant stock management app.

Getting started

Database

I'm using an in-memory h2 database. The database will be automatically created via a migration using Flyway

@therealcisse
therealcisse / isBusinessDay.java
Created August 13, 2018 07:10 — forked from greyaperez/isBusinessDay.java
Function to Check Whether Date is a Business Day or Not (ex: Weekend or Holiday)
/**
* Is Date A Business Day?
* @param cal
* @return boolean
*/
public boolean isBusinessDay(Calendar cal){
// check if weekend
if(cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY){
return false;
}
@therealcisse
therealcisse / instructions.txt
Created September 4, 2018 16:25 — forked from nathanborror/instructions.txt
Example Kubernetes setup with Postgres and two Services for serving an API and a static site using Ingress. Also have a CronJob example for kicks.
*** Cluster Setup for Google Container Engine ***
0/ Install and configure local gcloud and kubectl: https://cloud.google.com/sdk/docs/
> gcloud components install kubectl
1/ Configure Google Cloud account:
> gcloud config set account YOUR_EMAIL_ADDRESS
> gcloud config set project YOUR_PROJECT_ID
> gcloud config set compute/zone us-west1-a
> gcloud config set container/cluster example
@therealcisse
therealcisse / GuessTheNumber.scala
Created October 4, 2018 21:43 — forked from weihsiu/GuessTheNumber.scala
Example of using Eff monad
package catssandbox
import aiyou._
import aiyou.implicits._
import cats._
import cats.data._
import org.atnos.eff._
import org.atnos.eff.all._
import org.atnos.eff.syntax.all._
import IOEffect._
@therealcisse
therealcisse / scala_debugging_tricks.md
Created October 5, 2018 00:23 — forked from bbarker/scala_debugging_tricks.md
SBT and JVM Debugging tricks

IntelliJ and recursive data structures

You may need to override toString on any recursive or deeply-nested data structure, since IntelliJ will ask the Java Debugger (JDB) to call toString all the time. This will blow up your memory.

Remote debugging

Useful for any number of reasons: testing on a different OS, using lots of memory/cpu resources you don't have locally, etc.

See an Intellij / IDEA guide for background.