Skip to content

Instantly share code, notes, and snippets.

View musm's full-sized avatar

Mustafa Mohamad musm

View GitHub Profile
@tmlbl
tmlbl / meetup.jl
Last active October 27, 2015 01:07
Script to find Julia developers in your area using the GitHub API
using HTTPClient: HTTPC
using JSON
# Fill in your city name and GitHub API token
const MEETUP_LOCATION = lowercase("Seattle")
const API_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Pages of search results to examine. Warning - you WILL hit the rate limit
const NUM_PAGES = 1
typealias Field Union{AbstractString,Void}
@jbn
jbn / julia_type_hierarchy.jl
Created July 17, 2015 22:44
Julia Type Hierarchy
# Requested gist of code to produce:
# https://www.scribd.com/doc/271871142/Julia-Type-Hierarchy
#
# I just redirected the output to a dot file, then executed:
# dot -Tpdf julia.dot -o julia.pdf
function print_type_tree(t, parent=Any, seen=Set{DataType}())
# Avoid redundant edges.
t ∈ seen && return
push!(seen, t)
@jfarmer
jfarmer / 00_LICENSE.md
Last active January 4, 2017 08:43
It's like lisp, in JavaScript!
cmake_minimum_required(VERSION 2.6)
project(subclassdispatchtests)
set(CMAKE_BUILD_TYPE Release)
add_definitions(-std=c++11)
add_executable(subclassdispatchtests subclassdispatchtests.cpp)
@mkborregaard
mkborregaard / DepsPlot.jl
Created March 2, 2017 20:49
A Plots recipe for the dependency structure of julia packages
type MyGraph
source::AbstractVector{Int}
destiny::AbstractVector{Int}
end
type DepsGraph
g::MyGraph
d::Int
names::Vector{String}
end
#!/usr/bin/env julia
# inspired by http://stackoverflow.com/questions/40031913/simulate-a-bouncing-ball
# and the inspired Chris Rackauckas
using DifferentialEquations, ParameterizedFunctions, NLsolve, Luxor
f = @ode_def BallBounce begin
dy = v
dv = -g
@ufechner7
ufechner7 / RealTime.jl
Created August 23, 2015 17:47
Test script for the realtime performance of Julia
using Winston
const SIMUL_DUR = 10.0 # simulation time in seconds
const PeriodTime = 20e-3 # period time for the simulation in seconds
const workload = 20000 # workload in vector additions/ multiplications per simulation step
const vec_size = 3
const cpu_usage = zeros(round(Int, SIMUL_DUR / PeriodTime)) # data array to log the cpu usage
const vec = zeros(vec_size, workload) # preallocate data array of 3D vectors
@ZacLN
ZacLN / pkgdeps.jl
Created July 29, 2017 10:32
Find package dependencies
function pkgdeps(pkg::String, metadir = "/home/zac/.julia/v0.6/METADATA")
deps = []
for pdir in readdir(metadir)
if isdir(joinpath(metadir,pdir)) && "versions" in readdir(joinpath(metadir,pdir))
for ver in readdir(joinpath(metadir, pdir, "versions"))
if isfile(joinpath(metadir, pdir, "versions",ver,"requires"))
reqs = readlines(joinpath(metadir, pdir, "versions",ver,"requires"))
for r in reqs
if first(split(r, " ")) == pkg
push!(deps, (pdir, ver))
@Ismael-VC
Ismael-VC / .juliarc.jl
Last active December 23, 2017 15:22
~/.juliarc.jl
using Compat
# using Suppressor
using OhMyREPL
const SEPARATOR = "\n\n" * "#"^80 * "\n\n"
ENV["PYTHON"] = ""
ENV["JULIA_WARN_COLOR"] = :yellow
ENV["JULIA_INFO_COLOR"] = :cyan
# ENV["LISP_PROMPT_TEXT"] = "λ ↦ "
@iambkramer
iambkramer / Export-Chocolatey.ps1
Last active July 17, 2020 19:54 — forked from alimbada/Export-Chocolatey.ps1
Export installed Chocolatey packages as chocolatey script
choco list -lo -r -y | % { $_.Split('|') | select -First 1 } | % { "choco install " + $_ + " -y" }
choco list -lo -r -y | % { $_.Split('|') | select -First 1 } | % { "choco install " + $_ + " -y" } | Out-file choco-software.txt