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 December 27, 2023 23:34
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 March 27, 2024 07:46
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); }'
@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 May 16, 2024 16:28
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
@kaosf
kaosf / Gemfile
Last active September 20, 2017 03:29
earthquakeをRuby 2.4.0でインストールして動かすためのGemfile on 2017-02-20
source 'https://rubygems.org'
gem 'earthquake',
git: 'https://github.com/kaosf/earthquake',
branch: 'master'
# SHA1: b845de4c363aa3df7820f049d36aae210969d1d2
gem 'twitter-stream',
git: 'https://github.com/kaosf/twitter-stream',
branch: 'master'