Skip to content

Instantly share code, notes, and snippets.

View cnivolle's full-sized avatar
🎯
Focusing

Clément Nivolle cnivolle

🎯
Focusing
  • Clever Cloud
  • Nantes, France
View GitHub Profile

Keybase proof

I hereby claim:

  • I am cnivolle on github.
  • I am cnivolle (https://keybase.io/cnivolle) on keybase.
  • I have a public key ASAtEN3e1lOewIMdMFN8aIkl-mBOjIXBo5fB3paPnHKnZAo

To claim this, I am signing this object:

@cnivolle
cnivolle / warpscript
Created December 26, 2019 14:24
access logs warpscript 2 - clever cloud
// Fetch on the 'accessLogs' class for your application id as labels
[ '<READTOKEN>' 'accessLogs' { 'app_id' '<APP_ID>' } NOW 30 s ] FETCH
// get the path field
<%
DROP
VALUES
<% DROP
JSON->
'path' GET
@cnivolle
cnivolle / warpscript
Created December 26, 2019 14:22
warpscript access logs - clever cloud
// Get all application status code for the last hour
[ '<READTOKEN>' 'accessLogs' { 'app_id' '<APPLICATION ID>' } NOW 10 m ] FETCH
<%
DROP
'gts' STORE
// output new GTS
NEWGTS
$gts
<%
DUP
2016-05-18T12:16:56.782+02:00 291166561824943 91228 07934f3 DEBUG API req_d89d8e9f-f309-47b1-a1fa-ef9a6bc6385c user_cd580a1f-fc75-494b-8f6a-471134875af9 java.lang.IllegalArgumentException: Invalid format: "Fri, 12 Feb 2016 18:21:17 UTC" is malformed at " UTC"
2016-05-18T12:16:56.845+02:00 291166561930472 91228 07934f3 DEBUG API req_d89d8e9f-f309-47b1-a1fa-ef9a6bc6385c user_cd580a1f-fc75-494b-8f6a-471134875af9 at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:945) ~[joda-time.joda-time-2.9.3.jar:2.9.3]
2016-05-18T12:16:56.845+02:00 291166562001823 91228 07934f3 DEBUG API req_d89d8e9f-f309-47b1-a1fa-ef9a6bc6385c user_cd580a1f-fc75-494b-8f6a-471134875af9 at controllers.AssetInfo$.parseDate(Assets.scala:106) ~[com.typesafe.play.play_2.11-2.3.2.jar:1.0-SNAPSHOT]
2016-05-18T12:16:56.846+02:00 291166562220425 91228 07934f3 DEBUG API req_d89d8e9f-f309-47b1-a1fa-ef9a6bc6385c user_cd580a1f-fc75-494b-8f6a-471134875af9 at controllers.AssetsBuilder$$anonfun$controllers$AssetsBuilder$$maybeNotM
2016-05-18T12:16:56.758+02:00 [debug] application - An invalidate date was received: Fri, 12 Feb 2016 18:21:17 UTC
2016-05-18T12:16:56.758+02:00 java.lang.IllegalArgumentException: Invalid format: "Fri, 12 Feb 2016 18:21:17 UTC" is malformed at " UTC"
2016-05-18T12:16:56.845+02:00 at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:945) ~[joda-time.joda-time-2.9.3.jar:2.9.3]
2016-05-18T12:16:56.845+02:00 at controllers.AssetInfo$.parseDate(Assets.scala:106) ~[com.typesafe.play.play2.11-2.3.2.jar:1.0-SNAPSHOT]
2016-05-18T12:16:56.846+02:00 at controllers.AssetsBuilder$$anonfun$controllers$AssetsBuilder$$maybeNotModified$3.apply(Assets.scala:326) [com.typesafe.play.play_2.11-2.3.2.jar:1.0-SNAPSHOT]
2016-05-18T12:16:56.847+02:00 at scala.Option.flatMap(Option.scala:170) [org.scala-lang.scala-library-2.11.1.jar:na]
2016-05-18T12:16:56.847+02:00 at controllers.AssetsBuilder$$anonfun$controllers$AssetsBuilder$$maybeNotModified$3.apply(Assets.scala:325) [com.typesafe.play.play_2.11-2.3.2.j
# You can use `rake secret` to generate a secure secret key.
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
### Keybase proof
I hereby claim:
* I am cnivolle on github.
* I am cnivolle (https://keybase.io/cnivolle) on keybase.
* I have a public key whose fingerprint is BAA3 C81F F0C8 BF19 E418 1AAC 6B6F 93C4 B705 A932
To claim this, I am signing this object:
@cnivolle
cnivolle / ms_to_s_converter.js
Created September 10, 2012 12:30
Converts milliseconds to hours, minutes and seconds
function secondsToString(milliseconds)
{
var seconds = parseInt(milliseconds / 1000);
var minutes = parseInt(milliseconds / 1000 / 60);
var hours = parseInt( milliseconds / 1000 / 3600);
return minutes + " minutes " + seconds + " seconds";
}