Skip to content

Instantly share code, notes, and snippets.

@baweaver
baweaver / ruby_books.md
Last active April 11, 2025 11:21
A list of books for learning and expanding on your Ruby knowledge.

Ruby Book List

Learning Ruby

You're taking your first steps into Ruby

A good introduction to programming in general. Easy on newer programmers.

@spalladino
spalladino / Makefile
Created November 23, 2016 15:40
Proof of concept of Ruby extension written in Crystal
testruby.bundle: testruby.cr
crystal testruby.cr --link-flags "-dynamic -bundle -Wl,-undefined,dynamic_lookup" -o testruby.bundle
irb: testruby.bundle
irb -rtestruby -I.
clean:
rm -rf .crystal testruby.bundle
@vielhuber
vielhuber / _1.MD
Last active September 22, 2023 14:28
image optimization compression (jpg, png, gif, svg) for google page speed / progressive jpgs svgo #windows #linux

notes

  • use the latest version of the following tools (build them from source)
  • i spent a lot of time comparing and finally got to these final tools

jpg (lossless)

find . -iregex '.*\.\(jpg\|jpeg\)$' -type f -exec mozjpeg -copy none -optimize -progressive -outfile {} -verbose {} \;

jpg (lossy)

Oga vs Nokogiri

Benchmark Results

Warming up --------------------------------------
          oga.simple   503.000  i/100ms
           oga.xpath   677.000  i/100ms
             oga.css   783.000  i/100ms
     nokogiri.simple   450.000  i/100ms
      nokogiri.xpath   145.000  i/100ms
@roge
roge / NT.nut
Created August 24, 2016 13:12
Nade Training v1.0.4-beta by roge. Add file to "Counter-Strike Global Offensive/csgo/scripts/vscripts" then run `script_execute NT.nut` to run.
const NT_TIMER_ENTITY_TARGET_NAME = "NT_TimerEnt";
const NT_SCRIPT_VERSION = "1.0.4-beta";
NT_LastGrenade <- null;
NT_LastRestoredGrenade <- null;
NT_SavedGrenadePosition <- null;
NT_SavedGrenadeVelocity <- null;
NT_AwaitingSave <- false;
NT_IsPaused <- false;
@Nakilon
Nakilon / checklist.md
Last active May 28, 2021 12:49
new macOS configuration checklist
  • настроить все в System Preferences, например

    • выключить Correct spelling automatically
    • инвертировать кнопку Fn
    • поставить раскладки "США" (на новых макбуках тильды будет слева внизу) и "Русская - ПК"
  • выключить ускорение указателя трекпада и перелогиниться

    defaults write .GlobalPreferences com.apple.trackpad.scaling -1
  • настроить Finder (войти в настройки любой программы в Mac OS можно комбинацией ⌘,)

@subfuzion
subfuzion / curl.md
Last active June 29, 2025 03:39
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@ozh
ozh / server.cfg
Last active August 22, 2022 00:00
Quakelive Server Config
// Servers have the ability to run multiple gametypes, known as "factories." You should not add gameplay related
// cvars in the server config: they may get overwritten by the factory. For creating your own sets of gameplay rules,
// create a file ending in ".factories" inside baseq3/scripts, and refer to "Creating custom gametypes" in the
// server_readme.txt file.
// Be aware that factories can override any cvar, including ones specified in this config file.
set sv_hostname "SARL | CA | elo+stats | GLHF"
set sv_tags "clanarena, qlstats.net, ELO, SARL, no-whiners, glhf" // Comma delimited field of server tags to show in server browser.
@wvengen
wvengen / README.md
Last active January 5, 2025 05:20
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

@janlelis
janlelis / terminal-ansi-colors-benchmark.md
Last active January 9, 2024 11:12
Terminal Colors Benchmark: paint, rainbow, term/ansicolor, pastel, ansi, hansi