Skip to content

Instantly share code, notes, and snippets.

View musm's full-sized avatar

Mustafa Mohamad musm

View GitHub Profile
@musm
musm / break.jl
Last active March 10, 2020 21:25
Break Julia for fun (segfault/stackoverflows/etc.)
# credits: @TotalVerb, @oxinabox, @musm @mbauman @quinnj
julia --compile=no --precompiled=no
(x->@inbounds(x+=[0][x])+x)(9^9^9)
[@inbounds([][x])for x=9^9^9]
run(`1`)
@musm
musm / tests.jl
Last active October 20, 2016 08:22
using BenchmarkTools
using Base: sign_mask, exponent_mask
typealias IEEEFloat Union{Float16,Float32,Float64}
_isinf{T<:IEEEFloat}(x::T) = (reinterpret(Unsigned, x) & ~sign_mask(T)) == exponent_mask(T)
_isfinite{T<:IEEEFloat}(x::T) = (reinterpret(Unsigned, x) & exponent_mask(T)) != exponent_mask(T)
_isnan{T<:IEEEFloat}(x::T) = (reinterpret(Unsigned, x) & ~sign_mask(T)) > exponent_mask(T)
julia> @benchmark isinf(2.0)
[00:00:00] Build started
[00:00:00] git clone -q https://github.com/JuliaIO/JLD.jl.git C:\projects\jld-jl-28dqq
[00:00:02] git fetch -q origin +refs/pull/145/merge:
[00:00:02] git checkout -qf FETCH_HEAD
[00:00:02] Running Install scripts
[00:00:02] if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw "There are newer queued builds for this pull request, failing early." }
[00:00:03] (new-object net.webclient).DownloadFile($("http://s3.amazonaws.com/"+$env:JULIAVERSION), "C:\projects\julia-binary.exe")
[00:00:05] C:\projects\julia-binary.exe /S /D=C:\projects\julia
[00:00:21] IF EXIST .git\shallow (git fetch --unshallow)
[00:00:21] C:\projects\julia\bin\julia --startup-file=yes -e "versioninfo(); Pkg.clone(pwd(), \"JLD\"); Pkg.build(\"JLD\")"
@musm
musm / cracking.md
Created June 18, 2017 21:35 — forked from vertexclique/cracking.md
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

[00:00:00] Build started
[00:00:02] git config --global core.autocrlf input
[00:00:02] git clone -q --depth=50 https://github.com/JuliaLang/julia.git C:\projects\julia
[00:00:07] git fetch -q origin +refs/pull/21540/merge:
[00:00:09] git checkout -qf FETCH_HEAD
[00:00:16] Restoring build cache
[00:00:16]
[00:00:16] Cache 'x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z' - Downloading (63,558,997 bytes)...1%
[00:00:16] Cache 'x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z' - Downloading (63,558,997 bytes)...10%
[00:00:16] Cache 'x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z' - Downloading (63,558,997 bytes)...20%
[00:00:00] Build started
[00:00:00] git config --global core.autocrlf input
[00:00:00] git clone -q --depth=50 https://github.com/JuliaLang/julia.git C:\projects\julia
[00:00:06] git fetch -q origin +refs/pull/23046/merge:
[00:00:08] git checkout -qf FETCH_HEAD
[00:00:11] Restoring build cache
[00:00:11]
[00:00:12] Cache 'C:\cygdownloads' - Downloading (515,651,150 bytes)...1%
[00:00:13] Cache 'C:\cygdownloads' - Downloading (515,651,150 bytes)...10%
[00:00:14] Cache 'C:\cygdownloads' - Downloading (515,651,150 bytes)...20%
julia> versioninfo()
Julia Version 0.7.0-DEV.1208
Commit 952dc93489* (2017-08-02 23:54 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
In file included from H5PLint.c:32:0:
H5PLint.c: In function ‘H5PL__open’:
H5PLpkg.h:97:30: warning: implicit declaration of function ‘dlopen’; did you mean ‘fdopen’? [-Wimplicit-function-declaration]
# define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY)
^
H5PLint.c:326:27: note: in expansion of macro ‘H5PL_OPEN_DLIB’
if (NULL == (handle = H5PL_OPEN_DLIB(path))) {
^~~~~~~~~~~~~~
H5PLpkg.h:97:40: error: ‘RTLD_LAZY’ undeclared (first use in this function)
# define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY)
// the following disables italic comments!
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": ["comment"],
"settings": {
"fontStyle": ""
}
}
@musm
musm / README.md
Last active July 4, 2020 03:46 — forked from nickbudi/README.md
Cygwin git compatibility with VS Code (or other Windows programs) using cygpath

Cygwin Git + VS Code compatibility

Thanks and credit to mattn and ferreus on GitHub.

Check out wslpath if you're using the Windows Subsystem for Linux.