Skip to content

Instantly share code, notes, and snippets.

@freewind
freewind / gist:f0ad661b608c8c10fb87c8e9057ff54a
Created April 5, 2018 09:48 — forked from mestizo/gist:9167834
Completely disable IPv6 on OSX
#To Get List of Hardware
sudo networksetup -listallhardwareports
#To Disable IPv6 on Wifi Adapter
sudo networksetup -setv6off wi-fi
#To Disable IPv6 on Built-in Ethernet Adapter
sudo networksetup -setv6off Ethernet
# migrating from https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh
# Aliases
alias g='git'
#compdef g=git
alias gst='git status'
#compdef _git gst=git-status
alias gd='git diff'
#compdef _git gd=git-diff
alias gdc='git diff --cached'
@freewind
freewind / lens.scala
Created October 21, 2015 16:21 — forked from Centaur/lens.scala
Nested Lens
import monocle.macros.Lenses
import language.higherKinds
@Lenses("_") case class Street(name: String)
@Lenses("_") case class Address(street: Street)
@Lenses("_") case class Company(addresses: Seq[Address])
@Lenses("_") case class Employee(company: Company)
object ILens {
val employee = Employee(Company(Seq(
@freewind
freewind / sed cheatsheet
Created October 21, 2015 16:21 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
#!/bin/bash
REMOTE=play@SERVER_IP
REMOTE_APP=/home/play/PROJECT_NAME/
sbt stage || exit 1;
rsync -va target/ $REMOTE:$REMOTE_APP/target;
ssh $REMOTE "cd $REMOTE_APP; ./stop.sh";
ssh $REMOTE "cd $REMOTE_APP; ./start.sh";
#!/bin/sh
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.1.deb
sudo dpkg -i scala-2.11.1.deb
sudo apt-get update
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
<!-- normally you wouldn't show this -->
<div id="paste" contenteditable="true"></div>
<script type="text/javascript">
# Application dependencies
require:
- com.gelinsoft -> app-base 1.3.5
- com.gelinsoft -> config 1.2.2
- com.gelinsoft -> betterlogs 1.2i
- com.gelinsoft -> aaa 1.3b
#- play -> rythm 1.0.0-20120814a
- com.gelinsoft -> rythm 1.0.0-20120906
- play -> morphia 1.2.9