Skip to content

Instantly share code, notes, and snippets.

@tonsky
tonsky / user.keymap
Created Jun 4, 2014
LightTable keymap of Sublime shortcuts
View user.keymap
{ :+
{ :editor
{ "pmeta-/" [:toggle-comment-selection]
"ctrl-shift-up" [:editor.sublime.selectLinesUpward]
"ctrl-shift-down" [:editor.sublime.selectLinesDownward]
"pmeta-d" [:editor.sublime.selectNextOccurrence]
"ctrl-m" [:editor.sublime.goToBracket]
"ctrl-shift-m" [:editor.sublime.selectBetweenBrackets]
"shift-pmeta-space" [:editor.sublime.selectScope]
"ctrl-pmeta-up" [:editor.sublime.swapLineUp]
@stefanhoth
stefanhoth / build.gradle
Last active Mar 3, 2017
Simple plugin for build.gradle to instruct Jetbrains IDEA-based IDEs (IntelliJ, Android Studio) to download sources of the dependencies. More settings can be found here: http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaModule.html
View build.gradle
// your code
apply from: "build-plugins/idea-gradle-sources.gradle"
@jhankin
jhankin / SOInsetLabel.h
Created Nov 5, 2012
UILabel subclass encapsulating interior shadow functionality
View SOInsetLabel.h
//
// SOInsetLabel.h
//
// Created by Joseph Hankin on 11/2/12.
// From code posted by Rob Mayoff.
// http://stackoverflow.com/questions/8467141/ios-how-to-achieve-emboss-effect-for-the-text-on-uilabel
// Copyright (c) 2012 Joseph Hankin. All rights reserved.
//
@devisnik
devisnik / build.gradle
Last active Sep 5, 2017
Shrink Guava using Gradle
View build.gradle
apply plugin: 'base'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.sf.proguard:proguard-gradle:4.11'
}
}
@sethrylan
sethrylan / checkstyle.gradle
Last active Dec 25, 2018
Code Quality Tasks for Android
View checkstyle.gradle
configurations {
codequality
}
repositories {
mavenCentral()
}
dependencies {
codequality 'com.puppycrawl.tools:checkstyle:5.6'
@artem-zinnatullin
artem-zinnatullin / GradleWorkersPleaseStopTakingFocus.gradle
Created Jul 21, 2015
Prevent Gradle Workers from taking focus! #DevelopersLikeComfort
View GradleWorkersPleaseStopTakingFocus.gradle
// You can place it in the root build.gradle
allprojects {
tasks.withType(JavaForkOptions) {
// Forked processes like GradleWorkerMain for tests won't steal focus!
jvmArgs '-Djava.awt.headless=true'
}
}
View KtorApp.kt
package main
import com.zaxxer.hikari.HikariDataSource
import org.apache.ibatis.annotations.Insert
import org.apache.ibatis.annotations.Select
import org.apache.ibatis.mapping.Environment
import org.apache.ibatis.session.Configuration
import org.apache.ibatis.session.SqlSession
import org.apache.ibatis.session.SqlSessionFactory
import org.apache.ibatis.session.SqlSessionFactoryBuilder
@cyrilmottier
cyrilmottier / _app_avelibRelease_res_values_config.xml
Last active Nov 20, 2020
Using the new Gradle-based Android build system: an example
View _app_avelibRelease_res_values_config.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="config_app_name">AVélib</string>
<string name="config_authority">com.cyrilmottier.android.avelib.citybikes</string>
<string name="config_com.google.android.maps.v2.api_key">XXX</string>
</resources>
@sergeycherepanov
sergeycherepanov / blog.example.com.toml
Last active Jan 5, 2021
Traefik Systemd Example with letsencrypt
View blog.example.com.toml
# /etc/traefik/conf.d/blog.example.com.toml
[frontends.blog]
backend = "blog"
passHostHeader = true
entrypoints = ["https", "http"]
priority = 100
[frontends.blog.ratelimit]
extractorfunc = "client.ip"
[frontends.blog.ratelimit.rateset.rateset1]
period = "10s"
@shibukawa
shibukawa / build graphiviz as layout engine
Created Jan 22, 2013
Graphviz's "plain" output is good for layout engine. This command creates the simplest Graphviz binary on Mac. You can easy to bundle your own program. I will try to run on Windows or cross-compile. This build supports only following output formats: canon cmap cmapx cmapx_np dot eps fig gv imap imap_np ismap pic plain plain-ext pov ps ps2 svg sv…
View build graphiviz as layout engine
#! /bin/sh
./configure --enable-static --disable-shared --disable-ltdl --disable-swig --disable-sharp --disable-go --disable-guile --disable-io --disable-java --disable-lua --disable-perl --disable-php --disable-python --disable-r --disable-ruby --disable-tcl --without-pic --without-tclsh --without-x --without-wish --without-expat --without-xpm --without-z --without-Xaw --without-webp --without-rsvg --without-ghostscript --without-visio --without-pangocairo --without-lasi --without-glitz --without-freetype2 --without-fontconfig --without-gtk --without-ming --without-qt --without-quartz --without-glut --without-cgraph --without-libgd --without-gdk_pixbuf LDFLAGS="-mmacosx-version-min=10.6"