Skip to content

Instantly share code, notes, and snippets.

<?php
function do_not_change_this_function() {
echo "Something is happening\n";
echo "this is important data\n";
ob_flush();
@retrospectacus
retrospectacus / runme.sh
Last active October 19, 2020 17:10
Thing to run on a schedule that updates some sort of config. It is a toy to illustrate/test some unix/bash constructs.
#!/usr/bin/env bash
tr=trigger
tr='==============_AUTOGENERATED_-_EDITS_BELOW_WILL_BE_CLOBBERED'
[ ! -f test.conf ] && cat <<EOF >test.conf
this
is a
trigger
test
#!/usr/bin/env bash
tr=trigger
tr='==============_AUTOGENERATED_-_EDITS_BELOW_WILL_BE_CLOBBERED'
[ ! -f test ] && cat <<EOF >test
this
is a
trigger
test
version: '2'
services:
db:
image: postgres:9.6
command: postgres -c 'max_connections=300' -c 'shared_buffers=4GB' -c 'work_mem=16MB' -c 'maintenance_work_mem=1GB' -c 'bgwriter_lru_maxpages=200' -c 'commit_delay=10' -c 'checkpoint_timeout=30min' -c 'checkpoint_warning=30min' -c 'log_timezone=Canada/Mountain' -c 'timezone=Canada/Mountain'
volumes:
- ${PWD}/docker/db/initdb.sh:/docker-entrypoint-initdb.d/initdb.sh
ports:
- "5432:5432"
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value
)
lazy val generateEventSerializer = TaskKey[Seq[File]]("generateEventSerializer", "Write code for me.")
generateEventSerializer := {
import sys.process._
"./make-proto-serializer.sh".!
import java.time.{Duration, ZonedDateTime}
object BruteFast extends App {
val startTime = ZonedDateTime.now
val theCorrectPassword = "ordaindrooppodlovelyemberlogic"
// val theCorrectPassword = "horsebutt"
// val dictionary = scala.io.Source.fromFile("/usr/share/dict/words").getLines.toVector
val dictionary = Vector("ordain","droop","pod","lovely","ember","logic")
<div class="modal show fade in" role="alert" style="z-index: 2420 !important;">
<div class="modal-backdrop show fade in" style="z-index: 2400 !important;"></div>
<div class="modal-dialog modal-md" style="z-index: 2500 !important;">
<div class="modal-content">
<div class="modal-header">
<h2>Confirm {{ actionName }} of {{ itemName }}</h2>
</div>
<div class="modal-body">
<p>Are you sure you want to {{ actionVerb }} this {{ entityName }}?</p>
<p>{{ itemName }}</p>
import {Injectable, Inject} from "@angular/core";
import {Http} from "@angular/http";
import {Observable, BehaviorSubject} from "rxjs";
@Injectable()
export class ThisDataService {
private thisData: BehaviorSubject<any[]> = new BehaviorSubject([]);
public thisDataObs$: Observable<any[]> = this.thisData.asObservable();
package domain.slick
import domain.model.{Area, Client, Id}
import slick.collection.heterogeneous.HNil
import slick.collection.heterogeneous.syntax._
import slick.driver.PostgresDriver.api._
import slick.lifted.{ProvenShape, Query, TableQuery, Tag}
class Areas(tag: Tag) extends Table[Area](tag, "areas") {
case class Book(title: String, category: String, rating: Int)
val t = List(
Book("The dark", "Mystery", 90),
Book("What is", "Romance", 55),
Book("This is what", "Mystery", 80),
Book("FPIS", "Reference", 99),
Book("Darker", "Mystery", 80),
Book("It isn't", "Romance", 82)
)