Skip to content

Instantly share code, notes, and snippets.

View opamp's full-sized avatar

opamp_sando opamp

  • Japan
View GitHub Profile
@opamp
opamp / scratchnote.el
Last active March 14, 2016 07:45
popwinでscratchバッファとは別の(標準ではorg-modeの)メモ用バッファを呼び出せる
;;;; scratchnote.el
;;; this code requires popwin.el
;;; configuration sample
;; (require 'scratchnote)
;; (global-set-key (kbd "C-c m") 'scratchnote-pop)
;; (scratchnote-restore)
;; (add-hook 'kill-emacs-hook 'scratchnote-save)
;;; code:
@opamp
opamp / qs.scala
Created June 17, 2013 05:17
practice in scala. QuickSort
val ar = Array(79,56,89,100,1,2,6,5,90,21,26,75,35,67,66,65,81,10,0)//適当な配列 (0 <= x <= 100)
def qs(a:Array[Int]):Array[Int] = {
if(a.length == 1) return a
val pivot = if(a(0) > a(1)) a(0) else a(1)
val a0 = qs(a.filter( _ < pivot))
val a1 = qs(a.filter( _ >= pivot))
Array.concat(a0,a1)
}
@opamp
opamp / mkfile.c
Created March 29, 2013 16:24
windowsで空ファイルの作り方がわからなかったので
#include<stdio.h>
#include<stdlib.h>
int mk_file(char*);
int main(int argc,char* argv[]){
int n;
@opamp
opamp / LogData.java
Created October 1, 2012 04:42
Logger
package com.example.Logger;
/* This class is for reading.When you use Logger::getLogData method,Logger class will return Array. its member is this class. */
public class LogData{
protected String message,state,date;
protected int y,m,d,h,min,s;
protected boolean e;
public LogData(){
@opamp
opamp / en.patch
Created June 2, 2012 18:09
Transform coordinates for Minecraft.
--- tc.lua 2012-06-03 12:32:38.000000000 +0900
+++ tc.en.lua 2012-06-03 12:36:24.000000000 +0900
@@ -29,20 +29,20 @@
function getCoordinates()
repeat
tmp = {}
- print("x座標")
+ print("x-coordinate")
tmp["x"] = tonumber(io.read())
- print("y座標")
@opamp
opamp / oyasumi.sh
Created November 29, 2011 03:57
昔書いたちょっとしたお休みタイマー ええ、単なるタイマーですよ
#!/usr/local/bin/zsh-4.3.11
#zshスクリプト あなたにおやすみタイマーを提供します。
#mplayerを呼び出すには /usr/local/bin /usr/bin /opt/local/binのいずれかにmplayerが入ってる必要がある
#Mplayerが有効な場合音を鳴らすなら以下の変数を書き換える-------------
SOUNDMUSIC="YES" #鳴らすならYES 値が不正なら無視されNO扱い
MFILE="" #鳴らす音のファイルPATH
LOG="YES" #カウント開始時間と終了時間のログを残すならYES
#---------------------------------------------------------------------
@opamp
opamp / main.py
Created November 11, 2011 11:47
PyQt_sample0
#!/usr/bin/python
#-*- encondig:utf-8 -*-
#pythonの実験で作ったやつ。pythonはわからんが. 単にQTextEditをMainWindowのセントラルウィジェットにしてMainWindowをshowしてるだけの簡単なもの。
from PyQt4 import QtCore,QtGui
import sys,os
class MainWindow(QtGui.QMainWindow):
def __init__(self,parent=None):
@opamp
opamp / dBconv.rb
Created November 1, 2011 08:15
デシベルと比を変換する簡易スクリプト
#!/usr/bin/env ruby
#-*- encoding:utf-8 -*-
# 1.9じゃないとちゃんと動かないようだよ。
if ARGV.size != 2 then
puts "dBconv -{n|v|w} n[dB|x]"
exit 0
end
@opamp
opamp / easye.rb
Created October 6, 2011 12:32
QtRuby超簡易メモ帳
require 'Qt4'
class MainWidget < Qt::Widget
def initialize
super
q_button = Qt::PushButton.new('quit')
connect(q_button,SIGNAL('clicked()'),$qApp,SLOT('quit()'))
txtedit = Qt::TextEdit.new
@opamp
opamp / rvmKorundum.rb
Created September 21, 2011 14:32
This can install korundum to ruby 1.9.2 of rvm on ArchLinux.
#!/usr/bin/env ruby
#-*- encoding:utf-8 -*-
=begin
Copyright (c) 2011,opamp
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.