Skip to content

Instantly share code, notes, and snippets.

View thatwist's full-sized avatar
👣

Yuri Ostapchuk thatwist

👣
View GitHub Profile
@sedm0784
sedm0784 / CapsLockCtrlEscape.ahk
Last active October 22, 2024 02:07
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}
@tsdeng
tsdeng / gist:7478579
Last active June 26, 2018 15:14
let speed bar recognize scala file perfectly
1. create ~/.ctags as follows(notice for regexps I used ^[ \t] to excactly match):
--langdef=Scala
--langmap=Scala:.scala
--regex-Scala=/^[ \t]*class[ \t]*([a-zA-Z0-9_]+)/class \1/c,classes/
--regex-Scala=/^[ \t]*object[ \t]*([a-zA-Z0-9_]+)/object \1/o,objects/
--regex-scala=/^[ \t]*trait[ \t]*([a-zA-Z0-9_]+)/trait \1/t,traits/
--regex-Scala=/^[ \t]*case[ \t]*class[ \t]*([a-zA-Z0-9_]+)/case class \1/m,case-classes/
--regex-Scala=/^[ \t]*abstract[ \t]*class[ \t]*([a-zA-Z0-9_]+)/abstract class \1/a,abstract-classes/
--regex-Scala=/^[^\*\/]*def[ \t]*([a-zA-Z0-9_]+)[ \t]*.*[:=]/f \1/f,functions/
#--regex-Scala=/^[^\*\/]*val[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/V,values/
@tsdeng
tsdeng / emacs_scala.md
Last active June 26, 2018 16:43
Configure Emacs for Scala

Basic Support

  1. Install ctags-exuberant
  2. Install gnu global
    • brew install global --with-exuberant-ctags
    • add following line in bash export GTAGSCONF=/usr/local/share/gtags/gtags.conf
    • edit gtags.conf, in the exuberant-ctags section, add following line :langmap=Scala:.scala:\
@claudinei-daitx
claudinei-daitx / SparkSessionS3.scala
Created December 15, 2017 13:02
Create a Spark session optimized to work with Amazon S3.
import org.apache.spark.sql.SparkSession
object SparkSessionS3 {
//create a spark session with optimizations to work with Amazon S3.
def getSparkSession: SparkSession = {
val spark = SparkSession
.builder
.appName("my spark application name")
.config("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
.config("spark.hadoop.fs.s3a.access.key", "my access key")