Skip to content

Instantly share code, notes, and snippets.

View hakopako's full-sized avatar

Ayaka Shimada hakopako

View GitHub Profile
@QuantumGhost
QuantumGhost / example.puml
Last active March 23, 2024 22:39
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@reterVision
reterVision / LRU.py
Last active March 1, 2023 02:32
LRU algorithm implemented in Python.
from datetime import datetime
class LRUCacheItem(object):
"""Data structure of items stored in cache"""
def __init__(self, key, item):
self.key = key
self.item = item
self.timestamp = datetime.now()
@uasi
uasi / git-svn.markdown
Last active March 5, 2024 07:06
git-svn の使い方メモ

git-svn の使い方メモ

git-svn の使い方をメモする。他によいプラクティスがあれば指摘していただけるとありがたい。

用語

SVN のブランチと git のブランチが混在しているため、ここではブランチという語を以下のように区別する。

  • ブランチ、 SVN ブランチ:$SVN_REPO/branches 以下にあるディレクトリ
  • ローカルブランチ:git のローカルブランチ
  • リモートブランチ:git のリモートブランチ
@noblejasper
noblejasper / python_boto_to_amazon_dynamodb.py
Created April 20, 2012 10:26
pythonからbotoを使ってAmazonDynamoDBを叩いてみた。
>>> import boto.dynamodb
>>> boto.dynamodb.regions()
[RegionInfo:us-east-1, RegionInfo:ap-northeast-1, RegionInfo:eu-west-1]
>>> boto.dynamodb.regions()[1]
RegionInfo:ap-northeast-1
>>> type(boto.dynamodb.regions()[1])
<class 'boto.regioninfo.RegionInfo'>
>>> region_info = boto.dynamodb.regions()[1]
>>> conn = region_info.connect(aws_access_key_id='', aws_secret_access_key='')
>>> conn