Skip to content

Instantly share code, notes, and snippets.

View michellescripts's full-sized avatar

Michelle Bergquist michellescripts

  • Denver, CO
View GitHub Profile
@JsonSerialize(using = SingularResponseSerializer::class)
data class SingularResponse<T> constructor(
val key: String,
val item: T
)
class SingularResponseSerializer<T>: JsonSerializer<SingularResponse<T>>() {
override fun serialize(value: SingularResponse<T>, gen: JsonGenerator, serializers: SerializerProvider) {
val obj: Map<String, T> = mapOf(value.key to value.item)
gen.writeObject(obj)
@alexislucena
alexislucena / uncommitLastCommit.md
Created November 14, 2016 08:56
Git: How to uncommit my last commit in git

To keep the changes from the commit you want to undo

$ git reset --soft HEAD^

To destroy the changes from the commit you want to undo

$ git reset --hard HEAD^

You can also say

@Kartones
Kartones / postgres-cheatsheet.md
Last active May 3, 2024 20:51
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@mschoebel
mschoebel / main.go
Created March 6, 2014 20:02
Snippet: login/logout (Golang)
package main
import (
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/securecookie"
"net/http"
)
// cookie handling
@smebberson
smebberson / .gitignore
Created January 9, 2012 06:46
Express simple authentication example
node_modules
*.swp