Skip to content

Instantly share code, notes, and snippets.

View kalabiyau's full-sized avatar
🐲
Breeding Dragons

Artem Chernikov kalabiyau

🐲
Breeding Dragons
  • Wildlife studios
  • Nürnberg, Germany
View GitHub Profile
@Jakuje
Jakuje / README.md
Last active December 1, 2023 17:36
OpenSC test Sign, Verify, Encipher and Decipher from commandline with OpenSSL CLI
export PIN=111111
export SIGN_KEY=11
export ENC_KEY=55

Sign/Verify using private key/certificate

  • Create a data to sign

    echo "data to sign (max 100 bytes)" > data
    
@3v1n0
3v1n0 / gpControl.json
Last active November 2, 2020 22:05
GoPro Hero4 Remote tools
{
"version":2.0,
"display_hints":[
{
"key":"GPCAMERA_GROUP_VIDEO",
"display_name":"Video Settings",
"settings":[
{
"setting_id":5,
"widget_type":"select",
package main
import (
"bufio"
"log"
"os"
)
var concurrency = 100
@sshaw
sshaw / yymmdd.rb
Last active August 29, 2015 14:05
Small DSL for idiomatic date parsing and formatting in Ruby. => Moved to https://github.com/sshaw/yymmdd
require "date"
# Small DSL for idiomatic date parsing and formatting in Ruby.
# https://gist.github.com/sshaw/53c27b148e903a07e494
#
# Usage:
#
# include YYMMDD
# date = Date.today
#
@miku
miku / .gitignore
Last active December 8, 2018 03:43
Golang XML worker queue example
xmlp
@lisamelton
lisamelton / transcode-video.sh
Last active May 24, 2024 17:42
Transcode video file (works best with Blu-ray or DVD rip) into MP4 (or optionally Matroska) format, with configuration and at bitrate similar to popular online downloads.
#!/bin/bash
#
# transcode-video.sh
#
# Copyright (c) 2013-2015 Don Melton
#
about() {
cat <<EOF
$program 5.13 of April 8, 2015
@chrisberkhout
chrisberkhout / heroku-pg-extras-bloat.sql
Last active December 21, 2022 03:16
Heroku's pg-extras queries in plain SQL (assumes pg >= v9.2)
-- show table and index bloat in your database ordered by most wasteful
-- https://github.com/heroku/heroku-pg-extras/blob/master/init.rb
WITH constants AS (
SELECT current_setting('block_size')::numeric AS bs, 23 AS hdr, 4 AS ma
), bloat_info AS (
SELECT
ma,bs,schemaname,tablename,
(datawidth+(hdr+ma-(case when hdr%ma=0 THEN ma ELSE hdr%ma END)))::numeric AS datahdr,
(maxfracsum*(nullhdr+ma-(case when nullhdr%ma=0 THEN ma ELSE nullhdr%ma END))) AS nullhdr2
FROM (
@willurd
willurd / web-servers.md
Last active July 19, 2024 02:15
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@teaforthecat
teaforthecat / initializers_dragonfly.rb
Last active December 11, 2015 06:09
Store the processed image on the datastore before being served by dragonfly (pre-caching). The url needs to be accesses programatically, like in a background job.
# store the job before it has a chance to be served by dragonfly
images.configure do |c|
c.define_url do |app, job, opts|
thumb = ThumbTracker.where(job: job.serialize).first
unless thumb
uid = job.store
thumb = ThumbTracker.create!(
:uid => uid,
:job => job.serialize
)
@jbgo
jbgo / debug_system_stack_error.md
Created January 9, 2013 15:08
debug SystemStackError in ruby 1.9

This is how I debug SystemStackError when there is no stack trace.

My first attempt was:

begin
  a_method_that_causes_infinite_recursion_in_a_not_obvious_way
rescue SystemStackError
  puts caller
end