Skip to content

Instantly share code, notes, and snippets.

View ararslan's full-sized avatar

Alex Arslan ararslan

  • Beacon Biosignals
  • Seattle, WA
  • 07:34 (UTC -07:00)
View GitHub Profile
#!/bin/bash
# Helper to jump to julia package source
function jlj()
{
if [[ $# != 1 ]]; then
echo "Usage: jlj <package name>" >&2
return
fi
using Cassette, Test
using Cassette: @context, enabletagging, @overdub, overdub, recurse,
hasmetadata, metadata, tag, untag
using ChainRules: frule, Zero, extern
@context DiffCtx
Cassette.metadatatype(::Type{<:DiffCtx}, ::Type{T}) where {T<:Real} = T
function D(f, x)
" deoplete.vim contains vim settings relevant to the deoplete autocompletion
" plugin
" for more details about my neovim setup see:
" http://afnan.io/2018-04-12/my-neovim-development-setup/
" deoplete options
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_smart_case = 1
" disable autocomplete by default
#supson.jl
type ツ; end
_(::Type{ツ}) = ツ
*(::Type{ツ}, ::Function) = ツ
type ⎺; end
Base.:\(::Type{⎺},::Type{ツ}) = ツ
Base.:/(::Type{ツ},::Type{⎺}) = true
⎺\_(ツ)_/⎺ #==> true
@davidanthoff
davidanthoff / packagedb.jl
Created October 18, 2016 23:49
PkgQuery
immutable Require
name::String
lower_bound::Nullable{VersionNumber}
upper_bound::Nullable{VersionNumber}
platform::Nullable{String}
end
immutable Version
version::VersionNumber
sha1::String
@prash-wghats
prash-wghats / Readme_VSCODE_FreeBSD
Last active June 4, 2021 08:21
Notes for Building Electron and VSCode in FreeBSD11
Copy all the files to the build directory.
Copy icudtl.dat to the build directory. (you can find it in the vscode downloads ex for linux).
chromium version in port is 52.0.2743.116.
This was built with FreeBSD 11.0-RELEASE-p1. If building with other versions probably need to change
the freebsd versions in diff files (ex. freebsd11 => freebsd10)
Installed
node => v6.9.1
npm => 3.9.2
>chmod 755 vscode_build.sh

Univariate API

A new univariate distribution type should implement all of the following methods:

  • Core constructors
    • MyDistribution{T}(args[...])
    • We need to clarify whether constructors should handle input validation or not. There are use cases in which people want to avoid input validation.
  • params(d::MyDistribution{T})::Tuple: A tuple of the distribution's parameters in our canonical order.
  • minimum(d::MyDistribution{T})::T: The lowest value in the support of MyDistribution.
  • maximum(d::MyDistribution{T})::T: The highest value in the support of MyDistribution.
@tsl0922
tsl0922 / .tmux.conf
Last active April 17, 2024 04:49
vim style tmux config
# vim style tmux config
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
@emiller
emiller / git-mv-with-history
Last active April 17, 2024 21:06
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
@simonbyrne
simonbyrne / IBMFloat64.jl
Created April 23, 2013 14:07
converts 64bit IBM floating point numbers to IEEE754 64bit floats
import Base.convert
bitstype 64 IBMFloat64
# ibm float format is hex based:
# * bit 1 = sign
# * bits 2-8 = exponent to the power of 16, with bias of 64
# * bits 9-64 = mantissa: no implied leading 1 (unlike ieee),
# typically normalised (hex of bits 9-12 is non-zero), though this need
# not be the case