Skip to content

Instantly share code, notes, and snippets.

View memo.el
(defun my-open-new-memo ()
(interactive)
(let ((my-regexp "\\([0-9]+\\)[.]memo")
(my-max 1)
(my-matched-num 0)
(file-list (directory-files "~/.emacs.d/memo/")))
(dolist (i file-list)
(setq my-matched-num (string-to-number (replace-regexp-in-string my-regexp "\\1" i)))
(if (< my-max my-matched-num)
(setq my-max my-matched-num)))
View index.html
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script type="text/javascript">
var globalTestItemNo = 1;
var TESTITEMNUM;
var DIVIDEDIMGNUM;
function globalTestItemNo2testName(globalTestItemNo){
View simplePaintApp.py
from PySide.QtGui import QApplication, QMainWindow, QAction, QActionGroup, QWidget, QCursor, QPainter
from PySide.QtCore import QTimer
import PySide.QtCore as QtCore
class W(QWidget):
def __init__(self):
QWidget.__init__(self)
self.resize(400,400)
self.myIsMousePressing = False
self.p = QPainter(self)
View timecount.py
from PySide.QtGui import *
from PySide.QtCore import QTimer
app = QApplication([])
widget = QWidget()
textbox = QLineEdit()
startbutton = QPushButton("start/stop")
resetbutton = QPushButton("reset")
timelabel = QLabel("00:00:00")
counttimer = QTimer()
hboxlayout = QHBoxLayout()
View cropBmp.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#This software is released under the MIT License, see below.
#----------------License----------------
#The MIT License (MIT)
#
#Copyright (c) <2015> <Kei Minagawa>
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
View Insert_string.py
# -*- coding: utf-8 -*-
import editor
import console
def main():
text = editor.get_text().decode('utf-8')
s,e = editor.get_selection()
srow, scol = get_row_col(s,text)
erow, ecol = get_row_col(e,text)
if scol != ecol:
View a.py
import re
import os
from pprint import pprint
def __init__():
cudirlist = os.listdir('.')
pprint(cudirlist)
print(
'abcd'
View Delete_rect.py
# -*- coding: utf-8 -*-
import editor
import console
def main():
text = editor.get_text().decode('utf-8')
s,e = editor.get_selection()
srow, scol = get_row_col(s,text)
erow, ecol = get_row_col(e,text)
if scol == ecol:
View Grep.py
# -*- coding: utf-8 -*-
import os
import sys
import re
import console
import editor
from datetime import datetime
INTERRUPT_TIME = 5
View Find.py
# -*- coding: utf-8 -*-
import os
import re
import editor
import console
home_dir = os.path.dirname(__file__)
current_dir = os.path.dirname(editor.get_path())
current_dir = os.path.relpath(current_dir, home_dir)
You can’t perform that action at this time.