Skip to content

Instantly share code, notes, and snippets.

View julik's full-sized avatar
💭
🎺

Julik Tarkhanov julik

💭
🎺
View GitHub Profile
@julik
julik / mrs.go
Last active January 27, 2019 23:36
Go MultiReadSeeker (for stringing together multuple ReadSeeker structs - for example for edge includes using ServeContent)
package mrs
import "io"
type multiReadSeeker struct {
Readers []io.ReadSeeker
Pos int64
BytesTotal int64
BytesRead int64
locations []location
@julik
julik / ring.rb
Last active January 15, 2019 20:32
A small ring buffer implementation in Ruby
# A ring buffer enumerable object
class Ring
include Enumerable
def initialize(size)
@array = Array.new(size)
@pos = 0
end
def pos
@julik
julik / watchist.rb
Last active August 31, 2017 13:41
For the guard-tired
require 'thread'
# I am very Watchist. Use me in your config.ru like so:
# Watchist.start_and_mount_in_rack(self)
class Watchist
CHMUX = Mutex.new
$watchist_channels = []
$watchist_logger = Logger.new($stderr)
$watchist_logger.progname = "watchist"
@julik
julik / testing.md
Created November 29, 2016 19:00 — forked from dwbuiten/testing.md

Things to Look for When Evaluating Encoders

"Our encoder mixes DCT synergies and gamma radiation to provide excellent quality that abides by industry standard salsa dancing techniques, using adaptive streaming techniques." — Beamr, probably.

First Steps

  1. First, verify they actually have a product to sell that actually exists and can be tested in-house.

    Warning signs: incredibly vague descriptions of the product, lots of "patent pending" claims with no real patents to be found, and insistence that they can do the testing for you and provide metrics instead of letting you test it yourself.

@julik
julik / testing.md
Created November 29, 2016 19:00 — forked from dwbuiten/testing.md

Things to Look for When Evaluating Encoders

"Our encoder mixes DCT synergies and gamma radiation to provide excellent quality that abides by industry standard salsa dancing techniques, using adaptive streaming techniques." — Beamr, probably.

First Steps

  1. First, verify they actually have a product to sell that actually exists and can be tested in-house.

    Warning signs: incredibly vague descriptions of the product, lots of "patent pending" claims with no real patents to be found, and insistence that they can do the testing for you and provide metrics instead of letting you test it yourself.

namespace :app, defaults: {format: :json} do
namespace :v1 do
resource :pro, only: [:create, :show, :destroy]
resource :application, only: [:show] do
get :messages
post :statistics
post :configuration
end
resources :people, only: [:index, :create, :update, :destroy]
resources :payloads, shallow: true, only: [:create, :destroy] do
@julik
julik / bug.c
Created May 12, 2016 21:46
clang -o bug bug.c -lcurl
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
#include <curl/curl.h>
#include <stdlib.h>
// Compiled and ran via
// $ clang -o bug bug.c -lcurl && ./bug
void perform_https_req() {
require 'thread'
class Sqewer::CallRecorder
Call = Struct.new(:method_name, :args, :blk)
NOOP = ->(*){}
def initialize(proxying_to)
@obj = proxying_to
@mutex = Mutex.new
@calls = []
@julik
julik / snappp.rb
Created February 2, 2016 13:47
Automatically upload screenshots to your S3 bucket and copy the link to the clipboard
#!/usr/bin/env ruby
require 'bundler'
Bundler.setup
require 'aws-sdk'
require 'rb-fsevent'
require 'terminal-notifier'
require 'clipboard'
# ENV['AWS_ACCESS_KEY_ID'] = #
@julik
julik / diff_grain.nk
Last active December 5, 2015 17:28
Differential grain extractor
set cut_paste_input [stack 0]
version 7.0 v6
push $cut_paste_input
push 0
Group {
inputs 2
name JT_ExtractGrain
selected true
xpos 291
ypos -489