Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# /share/MD0_DATA/.qpkg/autorun/autorun-plexconnect.sh
# chmod +x /share/MD0_DATA/.qpkg/autorun/autorun-plexconnect.sh
curl -L https://gist.github.com/tommeier/6255771/raw/update_plex_connect.sh | bash &
@pulse00
pulse00 / GithubJsonProtocol.scala
Last active November 4, 2021 10:19
spray-client http post request with custom header and json4s unmarshalling/marshalling
package com.example.actors.github
import spray.httpx.Json4sSupport
import org.json4s.{DefaultFormats, Formats}
/**
* Marshalling/Unmarshalling for the github json format
*
* see http://developer.github.com/v3/oauth/#web-application-flow
*/
export MYSQL_HOST="127.0.0.1"
echo "exported to"
echo $MYSQL_HOST # <--- here i get 127.0.0.1
# start php-fpm
service php5-fpm start
stage { 'first':
before => Stage['main'],
}
# be hacky first update sources list, before main stage
class apt_update {
exec { "update_sources_list":
command => "/usr/bin/apt-get update",
}
}
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.util.Date;
@RunWith(JUnit4.class)
return DateTimeFormat.forPattern(getTextFormat())
.parseDateTime(value.toString())
.withZoneRetainFields(DateTimeZone.UTC)
.toDate();
import java.util.Arrays;
import java.util.List;
public class Runner {
public interface Task {
void run();
default void cancel() {
// do nothing
}
<?php
/* direct access */
$dispatcher->addSubscriber(new \Statistics\Handler\MongoHandler($app['mongo']));
/* equals to */
/* @var $mongoService \MongoService */
$mongoService = $app['mongo'];
$dispatcher->addSubscriber(new \Statistics\Handler\MongoHandler($mongoService));
$thumbHeights: 15, 30, 25, 40;
@each $height in $thumbHeights {
img.thumbnail-#{$height} {
height: #{$height}px;
}
}
@(doc: Document)
@import com.example.Document
@import com.example.html.layout;
@layout(title = "Home") {
<h1>Hello @doc.getDocumentTitle !</h1>
}