Skip to content

Instantly share code, notes, and snippets.

@GlitchWitch
GlitchWitch / rtl8156-ubuntu.md
Last active July 30, 2025 12:10
Setup the RTL8156 USB2.5G Ethernet Adapter on Ubuntu 20.04
@yuri-karpovich
yuri-karpovich / gist:df4f52d7ad9211a47f4db281246244df
Created April 10, 2019 15:01 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@gagarine
gagarine / fish_install.md
Last active September 19, 2025 20:00
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@heroheman
heroheman / ranger-cheatsheet.md
Last active October 25, 2025 04:55
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts
@tobiashm
tobiashm / README.md
Created August 30, 2017 08:02
Use PhantomJS to render PDF in Rails

Use PhantomJS to render PDF in Rails

Avoid disk IO

If you're deploying your app to somewhere where you can't be sure to have reliable disk read/write access, the normal strategy of writing to a temp-file doesn't work. Instead we can open a pipe to the Phantom.js process, and then pass in the HTML via stdin, and then have the rasterize.js script write out the resulting PDF to stdout, which we can then capture. Any log messages from the Phantom.js process can be passed via stderr if we want.

Session heist

@yuri-karpovich
yuri-karpovich / weekly_runner.sh
Last active November 18, 2016 12:25
Run bash script only on even or predefined weeks
#/bin/bash
# Run only on even weeks
if [[ $DATE == "" ]]; then
echo "Using today's date"
today=`date +%Y%m%d`
else
echo "Using $DATE date"
today=$DATE
fi
@zentetsukenz
zentetsukenz / ruby_on_rails_deployment.md
Last active December 2, 2024 01:26
Deploy Ruby on Rails application with Docker Compose and Capistrano with ease

Docker

Files and Folders.

|
|\_ app
|...
|\_ docker
| |
@alexey-milovidov
alexey-milovidov / nested.txt
Created June 17, 2016 21:15
Example of Nested data type in ClickHouse.
:) CREATE TABLE test.nested (EventDate Date, UserID UInt64, Attrs Nested(Key String, Value String)) ENGINE = MergeTree(EventDate, UserID, 8192)
CREATE TABLE test.nested
(
EventDate Date,
UserID UInt64,
Attrs Nested(
Key String,
Value String)
) ENGINE = MergeTree(EventDate, UserID, 8192)
@evg2108
evg2108 / capistrano_deploy_strategies.md
Created October 12, 2015 15:06
Стратегии деплоймента в Capistrano

#Стратегии деплоймента в Capistrano Стратегии деплоймента в Rails настраиваются в файле config/deploy.rb. Сама настройка сводится к установке нескольких встроенных переменных в определённые значения.

# эта стратегия используется по умолчанию. Сводится она к тому,
# что на :app сервере запускается приложение svn которое обращается 
# к удалённому репозиторию и делает checkout указанного проекта.
set :deploy_via, :checkout
@drogus
drogus / Rakefile.rb
Created July 26, 2013 10:49
This is the example contents of the Rakefile, which you would use to run active record tasks without using Rails. It assumes using the same directories as rails uses: `db/migrate`, `config/database.yml`.
require 'bundler/setup'
require 'active_record'
include ActiveRecord::Tasks
db_dir = File.expand_path('../db', __FILE__)
config_dir = File.expand_path('../config', __FILE__)
DatabaseTasks.env = ENV['ENV'] || 'development'