Skip to content

Instantly share code, notes, and snippets.

View Drunkar's full-sized avatar

Akio Ohta Drunkar

View GitHub Profile
@pplante
pplante / tornado-flash-message-mixin.py
Created April 10, 2011 00:32
Store a message between requests which the user needs to see. Similar to the functionality available in Django/Rails.
# Copyright (c) 2011 Phil Plante <unhappyrobot AT gmail DOT com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@phillro
phillro / gist:1193227
Created September 4, 2011 17:59
Elasticsearch autocomplete example with cross origin resource sharing
<html>
<head>
<link rel="stylesheet" href="/examples/stylesheets/ui-lightness/jquery-ui-1.8.16.custom.css" type="css">
<script type="text/javascript" src="/examples/javascripts/jquery.min.js"></script>
<script type="text/javascript" src="/examples/javascripts/jquery.base64.min.js"></script>
<script type="text/javascript" src="/examples/javascripts/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="/examples/javascripts/jquery.tmpl.min.js"></script>
</head>
<body>
@mkroman
mkroman / Network.cpp
Created November 17, 2011 01:42
Uncrustify configuration inspired by Google's C++ styleguide.
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <string.h>
#include <iostream>
#include <stdarg.h>
#include <stdio.h>
@alumican
alumican / testApp.cpp
Created January 14, 2012 15:32
openFrameworksとZinniaで手書き文字認識
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup()
{
ofSetDataPathRoot("data/");
ofBackground(0);
//setup recognizer
recognizer = zinnia::Recognizer::create();
@gre
gre / easing.js
Last active April 30, 2024 04:58
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@mrchilds
mrchilds / gist:1729289
Created February 3, 2012 09:30
Strip all HTML from string using BeautifulSoup
from BeautifulSoup import BeautifulSoup
body = "<p>Dear Everyone,</p><p>This is a test</p><h1>Test Complete</h1>"
plain_text = ' '.join(BeautifulSoup(body).findAll(text=True))
@volpe28v
volpe28v / auto_scp.sh
Created March 12, 2012 09:38
scpを自動化するスクリプト
#!/bin/bash
HOST=対象ホスト名(IPアドレス)
USER=ログインユーザ
PASS=パスワード
TARGET_DIR=バックアップディレクトリ(ファイル)
BACKUP_DIR=保存先ディレクトリ
expect -c "
set timeout -1
@robotconscience
robotconscience / Syscommand.h
Last active October 8, 2017 21:49
openFrameworks threaded system command caller with output
//
// SysCommand.h
//
// Created by Brett Renfer on 2/22/12.
//
#pragma once
#include "ofThread.h"
class SysCommand : private ofThread
@hayajo
hayajo / changelog_en.md
Last active April 16, 2024 12:57
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@narusemotoki
narusemotoki / dirwatch.py
Created November 12, 2012 12:35
ディレクトリを監視して,ファイルに変更があった場合に任意のコマンドを実行します.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import datetime
import time
import os
from stat import *
import commands
def watch(dir, command):