Skip to content

Instantly share code, notes, and snippets.

💭
:trollface:

Victor Maslov Nakilon

💭
:trollface:
Block or report user

Report or block Nakilon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@obelisk68
obelisk68 / tetris_for_Ruby2D.rb
Last active Oct 14, 2019
Ruby2D を使ったテトリス
View tetris_for_Ruby2D.rb
require "ruby2d"
include Ruby2D::DSL
Wait = 18
class Tetromino
def initialize
@pat = Array.new(4)
pats = [["1111"], ["11", "11"], ["011", "110"], ["110", "011"],
["100", "111"], ["001", "111"], ["010", "111"]]
@spalladino
spalladino / Makefile
Created Nov 23, 2016
Proof of concept of Ruby extension written in Crystal
View Makefile
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
@roge-
roge- / NT.nut
Created Aug 24, 2016
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.
View NT.nut
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;
@ozh
ozh / server.cfg
Last active Aug 13, 2017
Quakelive Server Config
View server.cfg
// 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 Nov 19, 2019
Ruby memory analysis over time
View README.md

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

View code_style.md

My preferred code style is 2-space K&R. This is intended to provide a justification for this style.

Why K&R?

K&R style has the following properties:

  1. Provides symmetric size (in terms of screen space consumed) between the opening and closing syntax of a clode block.
  2. Forces no empty/meaningless lines, thereby avoiding artificial distance between related things that should be together.
  3. Consumes the minimum vertical space while keeping the opening and closing syntax of the block on separate lines from the content.
@h2non
h2non / libvips-installer.sh
Last active Oct 20, 2019
libvips 7.42.x cross-platform simple installer script (supports OSX, Debian, Ubuntu, CentOS, Fedora, Amazon Linux)
View libvips-installer.sh
#!/bin/sh
#
# Orinally made by Lovell Fuller for sharp
# https://github.com/lovell/sharp
#
# Usage:
# curl -s https://gist.githubusercontent.com/h2non/89bb2f87c6499d0b25f1/raw/bf3d0743107f02f5db2b93c53f7f0e07a1c33112/libvips-installer.sh | sudo bash -
#
View display-class-hierarchy-tree.rb
#!/usr/bin/env ruby
# A more general case of finding all of the classes in a hierarchy
#
# Inspired by Nick Sieger's excellent article
# http://blog.nicksieger.com/articles/2006/09/06/rubys-exception-hierarchy/
#
top_class = Exception
prune_below = [ SystemCallError ]
outer_modules_to_skip = %w[ Gem ]
@stephan-nordnes-eriksen
stephan-nordnes-eriksen / key-value-performance-test.md
Last active Aug 19, 2019
Performance testing different Key-Value stores in Ruby
View key-value-performance-test.md

For a project I am on I need to use a key-value store to converts file-paths to fixnum IDs. The dataset will typically be in the range of 100 000 to 1 000 000. These tests use 305 000 file paths to fixnum IDs.

The Different Key-Value stores tested are:

Daybreak: "Daybreak is a simple and very fast key value store for ruby" GDBM: GNU dbm. "a simple database engine for storing key-value pairs on disk." DBM: "The DBM class provides a wrapper to a Unix-style dbm or Database Manager library" PStore: "PStore implements a file based persistence mechanism based on a Hash. "

Out of these, all except Daybreak are in the Ruby standard library.

@magnetikonline
magnetikonline / README.md
Last active Mar 4, 2019
Nginx embedded variables.
View README.md
You can’t perform that action at this time.