Skip to content

Instantly share code, notes, and snippets.

View Drunkar's full-sized avatar

Akio Ohta Drunkar

View GitHub Profile
@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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
@danasf
danasf / index.html
Last active September 28, 2016 06:02
LED patterns with Edison
{
"name": "LEDPatternTest",
"description": "Testing WS2801 LED Strip on Intel Edison",
"version": "0.0.0",
"main": "main.js",
"engines": {
"node": ">=0.10.0"
},
"dependencies": { "mqtt": "^0.3.11" }
}
@yossale
yossale / slugline_shortner.js
Last active December 28, 2016 15:34
Fix "error: Value in [posts.slug] exceeds maximum length of 150 characters." error when importing from Wordpress to Ghost
var fs = require('fs');
var filePath = process.argv[2];
var content = null;
fs.readFile(filePath, 'utf8', function (err, data) {
if (err) {
console.log('Error: ' + err);
return;
}
@nosuz
nosuz / bom2excel.rb
Last active February 6, 2017 09:10
#!/usr/bin/ruby
#require 'csv'
require 'axlsx'
require 'rexml/document'
Component = Struct.new(:item, :ref, :value, :footprint)
Order = Struct.new(:item, :value, :footprint, :count)
xml_file = File.expand_path(ARGV[0])
@Bruttagente
Bruttagente / PoloniexCompleteBalance.gs
Last active September 8, 2017 05:09
Google Script to fetch the Poloniex balance and fill a Sheet with the retrieved data
//This is a simple Google Script to fetch the personal balance from the Poloniex website and fill a Google Sheet.
//You had to insert you API key and secret where indicated, and use your own Google Sheet address and sheet name.
//
//If you find this script useful, you can send me a tip on my bitcoin address: 17wzVMssHULq3LcJaESBkiB2cu2L9yCYn1
//
function sendHttpPost() {
//if you get an error about the nonce number, change it with a greater one as suggested by the debug
@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
@ksasao
ksasao / analog_mic_draw.ino
Last active May 17, 2018 04:11
[M5Stack] mic input test (speaker noise suppressed) refer to https://gist.github.com/ksasao/485ffbccbf3c47ea9cb814d3484e85e0
#include <driver/adc.h>
#include <M5Stack.h>
const int _bufSize = 128;
int _buf[_bufSize]; // adc buffer for suppress speaker noise
int _pos = 0;
int _old = 0;
int _count = 0;
int _offset = 0;