Skip to content

Instantly share code, notes, and snippets.

View iberianpig's full-sized avatar

Kohei Yamada iberianpig

View GitHub Profile
@Showfom
Showfom / Analyticus
Created September 10, 2017 12:47
InstantClick with Google Analytic Integration
// Google Analytic
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-54138102-1', 'auto');
ga('send', 'pageview');
// Disqus Comment
var disqus_shortname = "riespandi";
@phansch
phansch / yardoc_cheatsheet.md
Last active February 10, 2026 23:42 — forked from chetan/yardoc_cheatsheet.md
Improved YARD cheatsheet
1 #! /bin/bash
2 #set -x
3
4 if [[ $1 == 'R' ]]; then
5 wmctrl -s $(wmctrl -d | grep \* | awk '{print $1+1}')
6 fi
7 if [[ $1 == 'L' ]]; then
8 CURRENT=$(wmctrl -d | grep \* | awk '{print $1}')
9 if [[ $CURRENT == 0 ]]; then
10 wmctrl -s 0
@AnderRasoVazquez
AnderRasoVazquez / comands.sh
Last active October 9, 2020 11:36
[Terminal Commands To Initiate Gala Windows And Workspaces Actions in elementary OS] #elementaryos #bash #shell
Open a Terminal and try the next commands :
dbus-send --session --dest=org.pantheon.gala --print-reply /org/pantheon/gala org.pantheon.gala.PerformAction int32:1
Luna : Workspace Overview ( keep Enter pressed ), Freya : Multitasking View
dbus-send --session --dest=org.pantheon.gala --print-reply /org/pantheon/gala org.pantheon.gala.PerformAction int32:2
Terminal maximizes
dbus-send --session --dest=org.pantheon.gala --print-reply /org/pantheon/gala org.pantheon.gala.PerformAction int32:3
Terminal minimizes
@SergKolo
SergKolo / qdbus_windows.sh
Created April 24, 2016 03:19
listing apps and their windows with qdbus
#!/bin/bash
get_window_paths()
{
qdbus org.ayatana.bamf /org/ayatana/bamf/matcher org.ayatana.bamf.matcher.WindowPaths
}
get_running_apps()
{
qdbus org.ayatana.bamf /org/ayatana/bamf/matcher org.ayatana.bamf.matcher.RunningApplications
@iberianpig
iberianpig / breadcrumb_helper.rb
Last active April 13, 2017 02:51
パンくずリストを構造化付きデータごとレンダリングさせるカスタムビルダ breadcrumbs_on_railsがベース(https://github.com/weppos/breadcrumbs_on_rails)
module BreadcrumbHelper
def render_breadcrumbs
super(builder: CustomBreadcrumbsBuilder)
end
end
class CustomBreadcrumbsBuilder < BreadcrumbsOnRails::Breadcrumbs::SimpleBuilder
def initialize(context, elements, options = {})
super
@options[:separator] = ' > '
@iberianpig
iberianpig / db.rake
Last active July 5, 2023 14:15
lib/tasks/db.rake (mysql_dump/mysql_restore/dump_seed_fu) using ActiveRecord configuration
# ./lib/tasks/db.rake
require 'active_record'
@logger = Logger.new(STDOUT)
namespace :db do
desc "Dumps the database to tmp/dbname.dump"
task mysql_dump: [:environment, :load_config] do
environment = Rails.env
configuration = ActiveRecord::Base.configurations[environment]
@0mkara
0mkara / Ethereum_private_network.md
Last active July 29, 2025 14:38
Ethereum private network configuration guide.

Create your own Ethereum private network

Introduction

Used nodes:

Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux
Linux localhost.localdomain 4.14.5-200.fc26.x86_64 #1 SMP Mon Dec 11 16:29:08 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
@padde
padde / lets-encrypt-nginx.md
Last active July 10, 2018 15:07
Let's Encrypt with Nginx

Let's Encrypt with Nginx

Here's how I set up a tiny Nginx/Rails server that uses HTTPS via a Let's Encrypt issued certificate.

https://letsencrypt.paddd.de/

Server

I use the smallest DigitalOcean droplet (512 MB) here, which is built from the "Ubuntu Ruby on Rails on 14.04" image provided by them.

@voluntas
voluntas / webrtc.rst
Last active January 13, 2025 22:40
WebRTC の未来