Skip to content

Instantly share code, notes, and snippets.

View pnlybubbles's full-sized avatar
🍋
is delicious!

pnly pnlybubbles

🍋
is delicious!
View GitHub Profile
@pnlybubbles
pnlybubbles / gulpfile.coffee
Last active December 10, 2015 11:30
gulpfile.coffee
gulp = require 'gulp'
plumber = require 'gulp-plumber'
coffee = require 'gulp-coffee'
coffee_react = require 'gulp-cjsx'
watchify = require 'gulp-watchify'
rename = require 'gulp-rename'
uglify = require 'gulp-uglify'
sourcemaps = require 'gulp-sourcemaps'
buffer = require 'vinyl-buffer'
@pnlybubbles
pnlybubbles / factorization.rb
Created January 25, 2015 06:32
メイドちゃんの素因数分解のとこだけ抜き出したもの
def powm(base, power, mod)
ret = 1
until power == 0
ret = ret * base % mod if power & 1 == 1
base = base * base % mod
power >>= 1
end
ret
end
@pnlybubbles
pnlybubbles / update_name.rb
Last active August 29, 2015 14:13
Minecarftの中でもupdate_nameしたい。プレーヤーの表示名を変えれるBukkitプラグイン。Puruginを利用。
# encoding: utf-8
class UpdateNamePlugin
include Purugin::Plugin
description 'UpdateName', 0.1
def on_enable
chatcolor = org::bukkit::ChatColor
public_command('update_name', 'change displayed name', '/update_name {id} {new_name}') do |sender, *args|
@pnlybubbles
pnlybubbles / quine_gen.rb
Last active January 4, 2020 09:58
Ruby Quine Generator. 2015年の書き初めです。
require "rmagick"
# require "pp"
raise "input file name" unless ARGV[0]
raise "file not found" unless File.exist?(ARGV[0].strip)
image = Magick::ImageList.new(ARGV[0])
img_depth = image.depth
@pnlybubbles
pnlybubbles / 2015_sheep_quine.rb
Created January 1, 2015 14:27
なもり先生の2015年アイコンQuine.
eval$s=%w'b="BAhsKwJ+Af////////////////////////////////////////////////////////////////////////////////////////
/////////////////4////////////////H/z//////////38AAP4BwP//////////BwABEPAH+P////////vh/w8A/h/8////////Af7/f4T/H
/7//////weA////wx88/v////9/AP/////Bzzz+/////x/4/////+Dnj///////A/z///9/4IfD//////8B/////z/AD8D/////APD//////4f/
AP///38A/P//////AwCA////BwD+//////8BAAb////gH/7////////7j///f/wf/v///y/+//mP//8f/x//////B////8f//8PPj/////+A///
/o///88HH////P8D///nR/9945uP/////////P/z/b/zz+f/5//////8f/v8//nz4P/j//////4/+/z8+Hv4f8P8f/P//wP//D8CD/w/+/w/+//
/D//8/cPj////3B////+P//x8A/////wOA////8///D8D////BAcD////x////8f///wAA////3/z //3/w////AeD///8f/v//f/j///+H//
///wf///8//P//////////gP///y/6/////////w8A8P//P/j/////////BwD4//9/8P/////// /+DAfz//38A/v///////+EB/v///wf/
//////9//P//////w////////w/+//////+H////////wP ///////w f+/////wHg////////DwDw/88v
AMD///////9/APj/hwcH4P////////8B4H8A8A/w/// / / ///fwAA AAD+D/z///////8f4L/w
AP///////////x/w
@pnlybubbles
pnlybubbles / revive.rb
Last active December 15, 2015 21:37
死体を数回クリックすることで仲間を蘇生できるようにするBukkitプラグイン。Puruginを利用。
# encoding: utf-8
$glowstone_marker = true
$delete_dead_items = true
$indestructible_skull = true
class RevivePlugin
include Purugin::Plugin
description 'Revive', 0.2
@pnlybubbles
pnlybubbles / bot-2-main.rb
Last active August 29, 2015 13:55
わたしのメイドちゃん
# encoding: utf-8
Encoding.default_external = Encoding::UTF_8
$VERBOSE = nil # instead of -W0
require "timeout"
require "date"
require "cgi"
# require "pry"
# require_relative "./wac/lib/wac.rb"
@pnlybubbles
pnlybubbles / pm1.rb
Created January 30, 2014 13:31
素因数分解するやつ。"ruby pm1.rb 12345678987654321"
# encoding: utf-8
def powm(base, power, mod)
ret = 1
until power == 0
ret = ret * base % mod if power & 1 == 1
base = base * base % mod
power >>= 1
end
ret
@pnlybubbles
pnlybubbles / bot-2-sample.rb
Last active August 29, 2015 13:55
TwitterBotを簡単につくるためのやつ。TwitterGem必要。
# encoding: utf-8
$VERBOSE = nil # instead of -W0
require_relative "./bot-2.rb"
# CONSUMER_KEY = ""
# CONSUMER_SECRET = ""
# ACCESS_TOKEN = ""
# ACCESS_TOKEN_SECRET = ""
# encoding: utf-8
price = 382
my_money = 1000
r = my_money - price
puts "#{price}円です"