Skip to content

Instantly share code, notes, and snippets.

@Nakilon
Nakilon / HOW TO (example).md
Last active March 9, 2021 06:52
streaming a still image with ability to replace it on the fly

Streaming local Moscow time:

  • mkdir stream && cd stream
  • test run:
    docker run --rm -it -v $(pwd):/mounted -w /mounted --log-driver local -e TZ=Europe/Moscow nakilonishe/alpine-vips-text sh -c "apk add tzdata && while sleep 0.5; do vips text image.v \"\$(date '+%Y-%m-%d%n %H:%M:%S')\" --dpi 200 --font Monospace && vips invert image.v atomic.png && mv atomic.png image.png; done"
    export key=...
    docker run --rm -it -v $(pwd):/mounted -w /mounted --log-driver local -e key -e loglevel=info -e s=640x360 -e preset=medium nakilonishe/ffmpeg-stream-image
@tigertv
tigertv / README.md
Created February 16, 2020 23:28 — forked from roachhd/README.md
Games on GitHub

Games on GitHub

Below is a list of open source games and game-related projects that can be found on GitHub - old school text adventures, educational games, 8-bit platform games, browser-based games, indie games, GameJam projects, add-ons/maps/hacks/plugins for commercial games, libraries, frameworks, engines, you name it.

Contributing

If you'd like to add a repository to the list, please create an Issue, or fork this repository and submit a pull request.

Help: MarkDown Help, Markdown Cheatsheet

@obelisk68
obelisk68 / tetris_for_Ruby2D.rb
Last active December 15, 2024 14:50
Ruby2D を使ったテトリス
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"]]
@komasaru
komasaru / ecef2blh.rb
Created February 24, 2019 04:16
Ruby script to convert ECEF to WGS84(BLH) coordinate.
#! /usr/local/bin/ruby
#---------------------------------------------------------------------------------
# ECEF -> BLH 変換
# : ECEF(Earth Centered Earth Fixed; 地球中心・地球固定直交座標系)座標を
# WGS84 の緯度(Latitude)/経度(Longitude)/楕円体高(Height)に変換する。
#
# Date Author Version
# 2019.02.19 mk-mode.com 1.00 新規作成
#
# Copyright(C) 2019 mk-mode.com All Rights Reserved.
@danielpowell4
danielpowell4 / google_sheet_report_writer.rb
Last active November 15, 2023 11:37
Write reports straight to google sheets! We use this in our Rails app to run queries and share the data outside the app.
require 'google/apis/sheets_v4'
require 'google/apis/drive_v3'
require 'googleauth'
require 'fileutils'
class GoogleSheetReportWriter
def initialize(notification_email:)
@creds = build_credentials
@notification_email = notification_email
end
@Nakilon
Nakilon / news.md
Last active June 6, 2025 19:26
The most important (in my opinion) changes in Ruby versions

N -- new feature -- I may consider using it
B -- breaking change -- I should review my code

N def-expr now returns the symbol of its name instead of nil.
N Array#to_h converts an array of key-value pairs into a Hash.
N Enumerable#to_h converts a list of key-value pairs into a Hash.
N Binding#local_variable_get(symbol)
N Exception#cause provides the previous exception which has been caught at where raising the new exception.
@kentbrew
kentbrew / lang_chrome_osx.md
Last active June 19, 2025 02:14
How to change the Chrome default language on OSX

How to Change your Chrome Default Language

Open up a Terminal window. (If you have never seen Terminal before, go to Spotlight Search and type "Terminal.")

In the Terminal box, try this:

defaults read com.google.Chrome AppleLanguages

If you see this:

The Story of NPM and Yarn

In the beginning there was NPM, and for a time it was good. Packages went forth and multiplied. The New Gods proclaimed the great demon Dependency Management had been slain. But The Old Gods knew better, for they had seen much and knew that the demon can never be killed, only held at bay.

The Old Gods were ignored. In the folly of a young age grew an abundance of packages and with them grew the scourge of dependency. In the depths beneath the earth, in a place beyond memory, the great demon stirred.

The first sign something was wrong was non-deterministic package version mismatches. “This is fine!” The New Gods declared. “A temporary setback, nothing more! We can fix it.” And so they introduced shrinkwrap, a lamp to combat the growing darkness.

But it proved to be too little, too late, and dusk continued to fall. The New Gods suffered their first major defeat at the [Battle of Left-pad](https://www.theregister.co.uk/2016/03/23/npm_left_

@am-kantox
am-kantox / digest_benchmark.rb
Created March 29, 2017 14:28
Ruby :: benchmark of different digests
require 'benchmark/ips'
n = 500000
require 'digest/md5'
require 'digest/sha1'
require 'digest/sha2'
require 'digest/sha3' # https://github.com/phusion/digest-sha3-ruby
INPUT = [5, "Hello, world", nil]