Skip to content

Instantly share code, notes, and snippets.

View kyanny's full-sized avatar

Kensuke Nagae kyanny

View GitHub Profile
@jonobr1
jonobr1 / auto-capture.scpt
Last active March 21, 2024 02:34
A small AppleScript to take a screenshot every 30 seconds for 8 hours. Saves to an Image Sequence in a desktop folder. Great for recording your workday.
set dFolder to "~/Desktop/screencapture/"
do shell script ("mkdir -p " & dFolder)
set i to 0
repeat 960 times
do shell script ("screencapture " & dFolder & "frame-" & i & ".png")
delay 30 -- Wait for 30 seconds.
set i to i + 1
end repeat
@willnet
willnet / create_image.rb
Created March 27, 2015 11:59
create image whose file size you can specify for test
#
# brew install imagemagick exiftool
#
system('convert -size 128x128 xc:blue test.jpg')
file_size = 1_048_576 - 448
ascii = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a
File.open('random.txt', 'w') do |file|
file.write(file_size.times.map { ascii.sample }.join)
@onk
onk / .rubocop.yml
Last active January 15, 2018 02:30
僕の使っている .rubocop.yml
# rubocop v0.35.0 から inherit_gem という機能が増えたので gem にしました
# https://github.com/onk/onkcop
inherit_gem:
onkcop: "config/rubocop.yml"
@drmohundro
drmohundro / private.xml
Last active September 21, 2017 00:36
Karabiner private.xml to swap option and command keys for Parallels
<?xml version="1.0"?>
<root>
<appdef>
<appname>PARALLELS</appname>
<equal>com.parallels.desktop.console</equal>
</appdef>
<devicevendordef>
<vendorname>MICROSOFT</vendorname>
<vendorid>0x045e</vendorid>
describe "App.request", ->
deferred = null
beforeEach ->
deferred = $.Deferred()
sinon.stub(App, "request").returns deferred.promise()
afterEach ->
App.request.restore()
@afn
afn / gist:c04ccfe71d648763b306
Created June 12, 2014 15:35
Restart phantomjs when it hangs
# Borrowed from https://github.com/y310/rspec-retry/blob/master/lib/rspec/retry.rb
CAPYBARA_TIMEOUT_RETRIES = 3
RSpec.configure do |config|
config.around(:each, type: :feature) do |ex|
example = RSpec.current_example
CAPYBARA_TIMEOUT_RETRIES.times do |i|
example.instance_variable_set('@exception', nil)
self.instance_variable_set('@__memoized', nil) # clear let variables
@eadz
eadz / gist:10220496
Created April 9, 2014 02:27
slack custom css
/*
User Stylesheet for Slack.
Use with http://www.squarefree.com/userstyles/make-bookmarklet.html
to make a custom css Bookmarket
*/
.light_theme .message {
(function() {
function Dispatcher() {
this.routes = [];
}
Dispatcher.prototype.route = function route(path, action) {
this.routes.push({ path: path, action: action });
return this;
};
alert('hello ' + document.location.href);
@masatomo
masatomo / github-url.el
Last active December 31, 2015 09:58 — forked from dagezi/github-url.el
Create a url to github from your local code.
moved to https://github.com/quipper/github-url.el