Skip to content

Instantly share code, notes, and snippets.

View hibariya's full-sized avatar

Hibariya hibariya

View GitHub Profile
<?php
class Bloc
{
private $source;
private $id;
private $args;
public function __construct($source, Array $args=null)
{
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'open-uri'
STDOUT.sync = true
words = {}
result_page = URI.parse('http://www.google.co.jp/search?num=100&hl=en&q=README+site:github.com').read
readme_links = result_page.scan(/['"](https?:\/\/[0-9a-z\-\.]:?[^'"<>:]+readme[\.0-9a-z]*)['"]/i).flatten.uniq
require 'formula'
class ScreenPre <Formula
url 'git://git.sv.gnu.org/screen.git'
homepage ''
md5 ''
version '4.1.0'
# depends_on 'cmake'
@hibariya
hibariya / vim.rb
Created July 20, 2011 06:35
vim formula
require 'formula'
class Vim <Formula
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
homepage 'http://www.vim.org/'
md5 '5b9510a17074e2b37d8bb38ae09edbf2'
head 'http://vim.svn.sourceforge.net/svnroot/vim/trunk/'
def install
system "./configure", "--prefix=#{prefix}",
@hibariya
hibariya / md-syntax.md
Created April 23, 2012 04:37
md-syntax
@hibariya
hibariya / gist:3129732
Created July 17, 2012 14:30
null@jp.rubyist.net に送れなかったらしくて
This is an automatically generated Delivery Status Notification
THIS IS A WARNING MESSAGE ONLY.
YOU DO NOT NEED TO RESEND YOUR MESSAGE.
Delivery to the following recipient has been delayed:
null@jp.rubyist.net
fatal: '/home/git/repositories/hibariya_retter.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
@hibariya
hibariya / gist:7040873
Last active December 25, 2015 21:09
子プロセスの入力を制御しつつ出力をいただきたい。 ruby から起動した bash の中で vim をつかいたいときはこんなかんじでいいの?
#!/usr/bin/env ruby
require 'pty'
require 'curses'
PTY.getpty 'bash' do |stdout, stdin, pid|
# 画面のサイズを変えてみる
stdin.puts 'stty rows 10'
stdin.puts 'stty cols 50'
@hibariya
hibariya / gist:7623686
Created November 24, 2013 05:23
ひとつの入力を複数のシェルで実行する
#!/usr/bin/env ruby
require 'curses'
require 'pty'
require 'landescape'
class Terminal < Struct.new(:window, :stdout, :stdin, :pid)
def wait
Process.detach(pid).join
end
@hibariya
hibariya / metacity-theme-3.xml
Created May 19, 2015 03:15
~/.local/share/themes/Adwaita/metacity-1
<?xml version="1.0"?>
<metacity_theme>
<info>
<name>Adwaita</name>
<author>GNOME Art Team &lt;art.gnome.org&gt;</author>
<copyright>&#194; Intel, &#194; Red Hat, Lapo Calamandrei</copyright>
<date>2012</date>
<description>Default GNOME 3 window theme</description>
</info>