Skip to content

Instantly share code, notes, and snippets.

View oieioi's full-sized avatar
🐙
🐙🐙🐙🐙🐙🐙🐙🐙🐙

oieioi

🐙
🐙🐙🐙🐙🐙🐙🐙🐙🐙
View GitHub Profile
@SyunWatanabe
SyunWatanabe / showmeta.js
Last active January 25, 2021 03:27
show meta
// ==UserScript==
// @name show meta
// @namespace http://tampermonkey.net/
// @version 0.1
// @description show meta what we want
// @author me
// @match *://*/*
// @grant none
// ==/UserScript==
@bessarabov
bessarabov / script.pl
Last active August 15, 2024 07:39
Script to generate data shown in post 'At what time of day does famous programmers work? Part 2. Workweek vs Weekend.' — https://ivan.bessarabov.com/blog/famous-programmers-work-time-part-2-workweek-vs-weekend
#!/usr/bin/perl
# This script is made to show graphs with git commit time made on workweek vs weekend
#
# The desription of this script and results of its usage is avaliable at:
# https://ivan.bessarabov.com/blog/famous-programmers-work-time-part-2-workweek-vs-weekend
#
# usage:
#
# git log --author="Sebastian Riedel" --format="%H %ai" | perl script.pl
@bessarabov
bessarabov / gist:674ea13c77fc8128f24b5e3f53b7f094
Last active August 23, 2024 19:11
One-liner to generate data shown in post 'At what time of day does famous programmers work?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'

(この記事はFarmnote Advent Calendar 21 日目の記事です)

札幌オフィスの金井(@kn1kn1)です。主にFarmnote ColorのETLを担当しています。

私にとっての2018年は、RubyKaigiでの登壇Algorave Tokyoへの出演があり、そして何よりも第二子誕生があって多忙な日々でした。関係した皆様に感謝致します。

さて、アドベントカレンダーということですが、諸々の都合(主に私の時間の都合)で技術的にゆるい話題になりました。きちんとした内容の記事をご所望の方は、ぜひ他のメンバーのエントリーをどうぞ。

Rockstar

@akinov
akinov / add_issue_template_link_for_github.user.js
Last active March 28, 2018 09:01
Add issue template link
@oieioi
oieioi / search_trace.rb
Created November 14, 2017 01:30
Earthquake plugin to search back
# encoding: UTF-8
Earthquake.once do
module TwitterOAuth
class Client
def search_queries(q, **options)
q = URI.encode_www_form_component(q)
options = URI.encode_www_form(options)
get("/search/tweets.json?q=#{q}&#{options}")
end
end
@arikfr
arikfr / README.md
Last active August 26, 2024 19:27
Redash Query Export Tool

Setup

$ pip install click requests

Usage

$ python query_export.py --redash-url "https://app.redash.io/" --api-key ""
@varmais
varmais / thinced.js
Created October 1, 2015 19:43
Geolocation to Promise wrap example
var getPosition = function (options) {
return new Promise(function (resolve, reject) {
navigator.geolocation.getCurrentPosition(resolve, reject, options);
});
}
getPosition()
.then((position) => {
console.log(position);
})
@oieioi
oieioi / favorites_trace.rb
Last active November 18, 2017 10:33 — forked from no6v/trace.rb
Trace back home or user timeline
# encoding: UTF-8
Earthquake.once do
module TwitterOAuth
class Client
def favorites_list(user, **options)
options = URI.encode_www_form(options)
get("/favorites/list.json?screen_name=#{user}&#{options}")
end
end
end
@caulfield
caulfield / rspec.rb
Last active March 2, 2020 04:27
Stub templates in rspec helper
module HelperExamplesExtensions
# Copy of stub_template from view specs
# @see RSpec::Rails::ViewExampleGroup::ExampleMethods#stub_template
def stub_template(hash)
view.view_paths.unshift(ActionView::FixtureResolver.new(hash))
end
end
RSpec.configure do |config|
config.include HelperExamplesExtensions, type: :helper