Skip to content

Instantly share code, notes, and snippets.

View lldbinit-Xcode
# ~/.lldbinit-Xcode
# Apple private methods
command regex ivars 's/(.+)/po [%1 _ivarDescription]/'
command regex methods 's/(.+)/po [%1 _methodDescription]/'
command regex shortmethods 's/(.+)/po [%1 _shortMethodDescription]/'
command regex nextviewcontroller 's/(.+)/po [%1 _nextViewControllerInResponderChain]/'
command alias nextvc nextviewcontroller
# Convenience
@Quar
Quar / predef.sc
Created Jan 15, 2019
ammonite predef.sc
View predef.sc
interp.load.ivy(
"com.lihaoyi" %
s"ammonite-shell_${scala.util.Properties.versionNumberString}" %
s"[${ammonite.Constants.version.replaceAll(raw"([\d]+\.[\d+]).*", "$1.0")},)" // use [x.x.0,) in case edge version no avail. in Maven
)
@
val shellSession = ammonite.shell.ShellSession()
import shellSession._
import ammonite.ops._
import ammonite.shell._
@Quar
Quar / build.sbt
Created Oct 8, 2018
spark2.3.2 assemblyMergeStrategy
View build.sbt
assemblyMergeStrategy in assembly := {
case PathList("org","aopalliance", xs @ _*) => MergeStrategy.last
case PathList("javax", "inject", xs @ _*) => MergeStrategy.last
case PathList("javax", "servlet", xs @ _*) => MergeStrategy.last
case PathList("javax", "activation", xs @ _*) => MergeStrategy.last
case PathList("org", "apache", xs @ _*) => MergeStrategy.last
case PathList("com", "google", xs @ _*) => MergeStrategy.last
case PathList("com", "esotericsoftware", xs @ _*) => MergeStrategy.last
case PathList("com", "codahale", xs @ _*) => MergeStrategy.last
case PathList("com", "yammer", xs @ _*) => MergeStrategy.last
@Quar
Quar / README.md
Last active Oct 25, 2018
auto-install old version of OpenFOAM on Ubuntu-18.04
View README.md

OpenFOAM Auto Install Script

Note that this script will try to auto install OpenFoam from souce (which means will download source code) and then compile on local machine. This script is primarily targated at installing old-releases of OpenFOAM which do not have binary installation packages pre-compiled on APT.

The entire installation time cost approximately 2-6 hours depends on network bandwidth and CPU memory power.

@Quar
Quar / .asoundrc
Created Sep 18, 2018
fix Thinkpad x120e no speaker sound on Ubuntu
View .asoundrc
# borrowed from wnelson on ubuntuforms
# https://ubuntuforums.org/showthread.php?t=1899601
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
@Quar
Quar / Makefile
Last active Jan 18, 2019
a very crude lazy script for dockerized SageMath on macOS
View Makefile
# Set Jupyter Notebook Root Directory on Host to be mounted in Docker
# such that all changes within Docker will be saved to local.
HOST_JUPYTER_NOTEBOOK_ROOT = $(PWD)/code
# if port 8888 on localhost has been used, change to another free port
CONTAINER_PORT = 8888
########################################
CONTAINER_NAME = sagemath
CONTAINER_CODE_ROOT = /home/sage/code
View pdftk.rb
require 'formula'
class PkgExtract < CurlDownloadStrategy
def stage
safe_system '/usr/bin/xar', '-xf', @tarball_path
chdir
safe_system 'mv *.pkg/Payload Payload.gz'
safe_system 'ls | grep -v Payload | xargs rm -r'
end
end
View brew_installed
adns
adwaita-icon-theme
akka
amap
ammonite-repl
ant
apache-spark
arp-scan
arpack
asciidoc
@Quar
Quar / README.md
Created Jun 14, 2018
Offline Install Python Package with `pip3`
View README.md

Offline Install Python Package with pip3

Yes you can do it with pip3 (or pip).

And it is simple.

Now we assume you have two computers, both have python3 and pip3 installed, and:

  • hostA has internet connection
  • hostB does not have internet connection
You can’t perform that action at this time.