Skip to content

Instantly share code, notes, and snippets.

View rokumatsumoto's full-sized avatar
:shipit:
shipping bits

Samet Gunaydin rokumatsumoto

:shipit:
shipping bits
View GitHub Profile
@rokumatsumoto
rokumatsumoto / spec_helper.rb
Created February 23, 2019 10:30
Multiple types of specs in metadata
%i(feature request).each do |type|
config.when_first_matching_example_defined(type: type) do
# enable db support only for feature or request specs
require 'support/db'
end
# include these Helpers only into feature or request specs
config.include(Helpers, type: type)
end
@rokumatsumoto
rokumatsumoto / horizontal-line-with-words.html.haml
Created February 10, 2019 23:06
responsive horizontal line with words by Bootstrap 4.1
.d-flex
%hr.my-auto.flex-grow-1/
.px-4 SOME TEXT HERE
%hr.my-auto.flex-grow-1/
@rokumatsumoto
rokumatsumoto / hamlit
Last active February 1, 2019 12:55
How to know if you are using hamlit
https://github.com/k0kubun/hamlit/issues/108
In Rails
ActionView::Template.handler_for_extension("haml")
=> #<Hamlit::RailsTemplate:0x005593caad2150>
In Sinatra, or any Tilt environment
Tilt["haml"]
@rokumatsumoto
rokumatsumoto / restart_bluetooth.sh
Last active January 21, 2019 14:50
Restart Bluetooth Daemon on macOS Sierra without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@rokumatsumoto
rokumatsumoto / postgresql-collate-ctype.sh
Last active January 21, 2019 14:49
postgresql collate and ctype
#!/bin/bash
# `myDB` is your database
# `OWNER = "myself"` is your role (default is your username, or check psql \du)
# tip: when Postgres is installed, it automatically creates a database user that matches your username,
# so that you can get started right away.
locale-gen tr_TR.UTF-8
@rokumatsumoto
rokumatsumoto / hac.rb
Created December 28, 2018 22:12
hac kura sayfasindaki degisiklikleri takip eder, sesli bildirir. sadece mac os sistemlerde calisir.
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open('http://hac.gov.tr/', open_timeout: 100))
File.open("hac.html", "wb") do |f|
f.write(doc.to_html)
end
doc1 = File.open("hac.html") { |f| Nokogiri::HTML(f) }
@rokumatsumoto
rokumatsumoto / keybase.md
Created November 16, 2017 18:38
Keybase proof

Keybase proof

I hereby claim:

  • I am rokumatsumoto on github.
  • I am sametg (https://keybase.io/sametg) on keybase.
  • I have a public key ASAjPyfUH3GPYbtZjMhuDxGseKRf1602hsD8ZwWX_y32Iwo

To claim this, I am signing this object: