Skip to content

Instantly share code, notes, and snippets.

View nimf's full-sized avatar

Yuri Golobokov nimf

  • Google
  • San Jose, CA
  • 14:51 (UTC -08:00)
View GitHub Profile
@nimf
nimf / Main.java
Created June 27, 2023 18:05
Java DNS lookup test
package org.example;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.List;
import javax.naming.NamingEnumeration;
import javax.naming.directory.Attribute;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
@nimf
nimf / curltime.sh
Last active March 24, 2023 22:22
Measuring HTTP/2 request with CURL
#!/usr/bin/env bash
HELP="Usage: curltime.sh HOSTNAME [SAMPLES_COUNT] [PATH]"
if [ $# -eq 0 ]; then
echo "Please, provide a hostname."
echo $HELP
exit 1
fi
@nimf
nimf / build-notifier.rb
Last active July 3, 2018 13:49 — forked from zoul/build-notifier.rb
Posts a message to the OS X notification center when a Jekyll build is finished. Requires TerminalNotifier, see http://git.io/5X99Eg or “gem install terminal-notifier”.
begin
require 'terminal-notifier'
module Jekyll
class Site
alias jekyll_process process
def process
jekyll_process
TerminalNotifier.notify("🍻 Jekyll rebuild finished")
rescue => e
TerminalNotifier.notify("💥 Jekyll rebuild failed: #{e.message}")
@nimf
nimf / Rakefile.rb
Last active February 12, 2016 16:56 — forked from drogus/Rakefile.rb
I found this in the answer by Jason to this question http://stackoverflow.com/questions/19206764/how-can-i-load-activerecord-database-tasks-on-a-ruby-project-outside-rails. This is a Rakefile for using ActiveRecord without Rails. It loads ActiveRecord's databases.rake file making ActiveRecord rake tasks available for your non-rails app.
require 'bundler/setup'
require 'active_record'
include ActiveRecord::Tasks
class Seeder
def initialize(seed_file)
@seed_file = seed_file
end