Skip to content

Instantly share code, notes, and snippets.

View iberianpig's full-sized avatar

Kohei Yamada iberianpig

View GitHub Profile
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 March 30, 2025 21:48
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 の未来

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@shouhei
shouhei / sample.py
Last active September 26, 2019 08:19
SQLAlchemy Python3 MySQL Geometroy
# Geometory型の設定
from sqlalchemy import func
from sqlalchemy.types import UserDefinedType
class Geometory(UserDefinedType):
def get_col_spec(self):
# カラムの型
return "GEOMETRY"
def bind_expression(self, bindvalue):