Skip to content

Instantly share code, notes, and snippets.

View DanyWallace's full-sized avatar
💭
everyone is a girl on the internet

Daniel Wallace DanyWallace

💭
everyone is a girl on the internet
View GitHub Profile
@DanyWallace
DanyWallace / Embedding GoLang into a Ruby application.md
Created July 11, 2022 07:01 — forked from schweigert/Embedding GoLang into a Ruby application.md
Embedding GoLang into a Ruby application - Blogpost to Magrathealabs

Go Title

I am passionate about Ruby, but its execution time compared to other languages is extremely high, especially when we want to use more complex algorithms. In general, data structures in interpreted languages become incredibly slow compared to compiled languages. Some algorithms such as ´n-body´ and ´fannkuch-redux´ can be up to 30 times slower in Ruby than Go. This is one of the reasons I was interested in embedding Go code in a Ruby environment.

For those who do not know how shared libraries operate, they work in a similar way as DLLs in Windows. However, they have a native code with a direct interface to the C compiler.

Note Windows uses the DLL system, and in this case, this does not necessarily have to be in native code.

One example is DLLs written in C#, which runs on a virtual machine. Because I do not use windows, I ended up not testing if it is poss

@DanyWallace
DanyWallace / latency.markdown
Created July 9, 2022 20:14 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@DanyWallace
DanyWallace / euphrasia2
Created August 25, 2020 22:58 — forked from bohoomil/euphrasia2
euphrasia X color scheme -- updated
!! euphrasia v2 by bohoomil
! euphrasia fg/bg
URxvt*background: #090C19
URxvt*foreground: #E6E6E6
URxvt*cursorColor: #1AAA13
! X.org apps bg/fg
*background: #D0CECB
*foreground: #090C19
@DanyWallace
DanyWallace / soundcloud.rb
Created March 2, 2016 20:14 — forked from arashm/soundcloud.rb
Simple script to downoad MP3 files from SoundCloud via WGet
#!/usr/bin/env ruby
require 'uri'
require 'httparty'
# Download mp3 files from SoundCloud
# Usage:
# ./soundcloud.rb https://soundcloud.com/tara-tiba/paeez_tara-tiba
class SoundCloud
include HTTParty
base_uri 'https://soundcloud.com'