Skip to content

Instantly share code, notes, and snippets.

@travisbrown
travisbrown / legacy-verified.csv
Last active June 16, 2024 08:42
Twitter accounts with legacy verification on 4 April 2023 (see https://twitter.com/travisbrown/status/1643229276278235136)
We can't make this file beautiful and searchable because it's too large.
Twitter ID, Screen name, Followers
12,jack,6526006
13,biz,2608289
20,ev,1679155
57,SarahM,17448
59,Tim535353,9340
76,marciadorsey,19501
224,davepell,57523
291,goldman,916937
@kairos34
kairos34 / ZipManager
Created March 19, 2019 15:06
Kotlin zip and unzip functions
object ZipManager {
fun zip(files: List<File>, zipFile: File) {
ZipOutputStream(BufferedOutputStream(FileOutputStream(zipFile))).use { output ->
files.forEach { file ->
(file.length() > 1).ifTrue {
FileInputStream(file).use { input ->
BufferedInputStream(input).use { origin ->
val entry = ZipEntry(file.name.toRealName())
output.putNextEntry(entry)
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.internal.HasConvention
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
//—————————————————————————————————————————————————————————————————————————————————————————————————
// BUILD SCRIPT.
//—————————————————————————————————————————————————————————————————————————————————————————————————
@staltz
staltz / introrx.md
Last active August 1, 2024 08:51
The introduction to Reactive Programming you've been missing
(def cds (collection))
;; interact with database
(go
(>! (:in cds)
{:op :create
:val {:title "Soft Machine Vol. 1"
:artist "Soft Machine"
:year 1969}})
@odrotbohm
odrotbohm / MyComponentImpl.java
Last active November 3, 2020 08:22
Constructor injection example with Lombok
/**
* Sample component implementation showing the usage of constructor injection
* avoiding the need to declare a constructor by the help of Lombok. There are
* several advantages of using constructor injection over field injection:
*
* <ol>
* <li>The class communicates its dependencies. Just start with {@code new
* MyDependencyImpl(…}and your IDE will tell you what you need to hand it in. No
* need to look into the implementation of the class to discover that.</li>
* <li>The class can only be used in valid state. The constructor argument require
@rymawby
rymawby / undo-git-rebase.sh
Created June 14, 2013 18:37
Undoing a git rebase
# find head commit
git reflog
# now reset hard - where N is the head commit found in the reflog
git reset --hard HEAD@{N}
@SeanTAllen
SeanTAllen / gist:3790659
Created September 26, 2012 21:21
The many things I ended up bookmarking at StrangeLoop 2012
Many of these are from Strangeloop talks and tweets, I can't promise all are as it was a fast paced mess (if anyone cares, these are in reverse order):
I found this last night: blueprints graph db adapter for datomic:
https://github.com/datablend/blueprints/tree/master/blueprints-datomic-graph
The Boundary crew continue building great things & sharing their experience via excellent blogging:
http://boundary.com/blog/2012/09/26/incuriosity-killed-the-infrastructur/
Disruptor Workshop Materials:
http://mechanitis.blogspot.com/2012/09/strangeloop-disruptor-workshop-materials.html
@jasonrudolph
jasonrudolph / 00-about.md
Created September 21, 2012 18:42
Rough Notes from Strange Loop 2012
@chitan
chitan / WsChatServlet.java
Created July 7, 2012 01:44
How to use WebSocket of Tomcat
//This sample is how to use websocket of Tomcat.
package wsapp;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.util.ArrayList;
import org.apache.catalina.websocket.MessageInbound;
import org.apache.catalina.websocket.StreamInbound;
import org.apache.catalina.websocket.WebSocketServlet;