Skip to content

Instantly share code, notes, and snippets.

@7kry
7kry / screen_grab_win.cpp
Last active February 10, 2017 16:32 — forked from philip-goh/screen_grab.cpp
Take a screenshot and write it out as a JPEG in C++ on Windows
#include <iostream>
#include <windows.h>
#include <gdiplus.h>
#include <memory>
using namespace Gdiplus;
using namespace std;
int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
{
@7kry
7kry / gpx_distance.rb
Last active August 29, 2015 14:02 — forked from dtan4/gpx_distance.rb
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'nokogiri'
require 'pp'
module GpxDistance
def calc_gpx_distance(gpx_file)
distance = calc_distance(get_latlons(gpx_file))
distance / 1000 # kilometers
#!/bin/bash
LANG=ja_JP.UTF-8
pid=$$
date=`date '+%Y-%m-%d-%H_%M'`
playerurl=http://radiko.jp/player/swf/player_3.0.0.01.swf
playerfile="/tmp/player.swf"
keyfile="/tmp/authkey.png"
@7kry
7kry / gist:8767969
Last active August 29, 2015 13:55 — forked from rhenium/gist:8767927
class Sample
def hello
puts "hello"
end
def hello2
puts "hello2"
end
end