Skip to content

Instantly share code, notes, and snippets.

hitme / Mac OS X: Open in Visual Studio Code
Last active April 14, 2020 07:44 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Quick Actions
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "" --args "$*"
- Save it as something like "Open in Visual Studio Code"
hitme / scala-annotations
Created May 10, 2019 04:53
import javaAnnotations.{ SomethingIzable, VaporElement}
import scala.reflect.runtime.{universe => ru}
import ru._
@SomethingIzable(value = “Teletransport”, level = 35)
case class Annotated (
field1 : Integer,
courtesy to
第一步:创建 Let's Encrypt 账号
openssl genrsa 4096 > account.key
openssl genrsa 4096 > domain.key
openssl req -new -sha256 -key domain.key -subj "/" > domain.csr
hitme /
Created April 11, 2018 01:58 — forked from meeuwer/
Generate Maven module dependency graph for a project
mvn org.fusesource.mvnplugins:maven-graph-plugin:reactor -Dhide-external=true
import pygame
text = "庞中华"
font = pygame.font.Font("/path/to/庞中华行书.ttf", 25)
rtext = font.render(text, True, (0, 0, 0), (255, 255, 255)), "t.gif")
hitme /
Created February 7, 2018 03:14 — forked from bastman/
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see:

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

hitme / dependency-report.gradle
Last active January 25, 2018 03:14 — forked from abesto/dependency-report.gradle
Gradle: multi-project dependency graph
task dependencyReport {
doLast {
def file = new File("")
file << "digraph {\n"
file << "splines=ortho\n"
allprojects.each { item ->
def from = item
.matching { it in ProjectDependency }
hitme / gist:82f547e704bbd552fdbba35757f7423d
Created November 14, 2016 02:39 — forked from pindia/gist:9b7787a607a5a676c6d8
Django session cookie migration
#
from django.conf import settings
from importlib import import_module
class UpdateSessionCookieMiddleware(object):
Migrates session data from an old (hardcoded) session cookie name and domain to the name and
domain currently defined in the Django settings.
hitme /
Created August 22, 2016 01:56 — forked from rchrd2/
Adding custom views to django's admin
from django.contrib import admin
from polls.models import Poll, Choice
from django.contrib.auth.models import User
from django.contrib.admin import AdminSite
from polls.views import index
class MyAdminSite(AdminSite):
hitme / gist:b6006c96b232b0574fa132509de07928
Created August 14, 2016 03:26 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1


Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at

All the codes here can be copied and run on Kotlin online editor.

Let's get started.