Skip to content

Instantly share code, notes, and snippets.

@erwan
erwan / bife-generation.txt
Last active May 9, 2023 07:24
ChatGPT bife
Here are example of BIFE functions:
IF ([Ticket Channel] == "Email") THEN [Ticket ID] ENDIF
I will ask you to write a BIFE function, and you will give only the function itself without any other text.
Write a BIFE function to find ticket id for the channel WhatsApp.
@erwan
erwan / mapStrings.scala
Created January 9, 2018 16:13
Map a functions to all Strings in circe
import io.circe._
import io.circe.syntax._
def mapStrings(json: Json)(f: String => String): Json = json.fold(
json, // null
_ => json, // boolean
_ => json, // number
str => f(str).asJson,
arr => arr.map(mapStrings(_)(f)).asJson,
obj => obj.mapValues(mapStrings(_)(f)).asJson
@erwan
erwan / Mode.scala
Last active December 22, 2017 12:06
import enumeratum._
sealed trait Mode extends EnumEntry
@SwaggerEnum
object Mode extends Enum[Mode] {
override def values = findValues
case object Initial extends Mode
case object Initial extends Mode
@erwan
erwan / pre-commit.sh
Created May 30, 2017 12:46
pre-commit to reject stop words
#!/bin/sh
# Reject commits on some stop words:
# nocommit: include this word (in a comment) when you're doing a local change that should not be committed
# fdescribe: used in jasmine to run a single test
declare -a stopwords=("nocommit" "fdescribe")
if git rev-parse --verify HEAD >/dev/null 2>&1
then
@erwan
erwan / pre-commit
Last active February 15, 2017 22:00
pre-commit hook to prevent committing unwanted changes
#!/bin/sh
# Reject commits on some stop words:
# nocommit: include this word (in a comment) when you're doing a local change that should not be committed
# fdescribe: used in jasmine to run a single test
#
# Usage: save in .git/hooks/pre-commit of a given repository, and make executable
declare -a stopwords=("nocommit" "fdescribe")

Keybase proof

I hereby claim:

  • I am erwan on github.
  • I am erwan (https://keybase.io/erwan) on keybase.
  • I have a public key whose fingerprint is 5F7B FD68 852C 06D7 1ECD 1BA7 0043 85C3 ECB3 45C9

To claim this, I am signing this object:

➜ ~ curl -I https://prismic-io.s3.amazonaws.com/townandcountryfinefoodswebsite%2F67760b8f-c9e5-413a-8598-1a8453a28045_starfish+curry+promotion.pdf
HTTP/1.1 200 OK
x-amz-id-2: Eu4WqGj+FRIo+TGc8vNFxWr9YJoq+UsnNjXANcH3yaTQ9XPzd/ev4T8PChcK+u5D
x-amz-request-id: EFB301EA162BEE73
Date: Tue, 14 Apr 2015 14:09:16 GMT
Cache-Control: max-age=315360000
Last-Modified: Mon, 02 Mar 2015 11:44:27 GMT
ETag: "c25a8e790aa56abc3c1031b0617c0945"
Accept-Ranges: bytes
Content-Type: application/pdf
define(['events', 'communication', 'animation', 'navigation', 'utils', 'releases', 'experiments', 'dropdown'], function(Events, Communication, Animation, Navigation, Utils, Releases, Experiments, Dropdown) {
var load = function(id, versionAndBase) {
var r = /^([^~]+)(~([^~]+))?$/.exec(versionAndBase),
version = r[1];
return Communication.group(
'history',
Communication.history(id, {
setup: focus(version),
container: '#history'
name := "common"
resolvers += "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases/"
libraryDependencies ++= Seq(
"org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka23",
"com.newrelic.agent.java" % "newrelic-api" % "2.21.3",
"org.apache.httpcomponents" % "httpclient" % "4.3.2",
"org.apache.httpcomponents" % "httpclient" % "4.3.2")
@erwan
erwan / urlib3fail.py
Last active August 29, 2015 14:10
urlib3fail.py
from __future__ import unicode_literals
import urllib3
try: # 2.7
import urllib.parse as urlparse
except ImportError: # 3.x
import urllib as urlparse
try:
import urllib3.contrib.pyopenssl