Skip to content

Instantly share code, notes, and snippets.

@yandod
yandod / action_mailer.php
Created May 28, 2011 18:48
ActionMailer - A reusable email class for CakePHP
<?php
/**
* Created: Sat Aug 05 02:19:40 EDT 2006
*
* A base class for application wide E-Mail sending/logic inspired
* by the Ruby on Rails ActionMailer.
*
* The Actionmailer is a hybrid of a Model and Controller since it
* renders it's own views to be send out via mail. The easiest way to
@yandod
yandod / SerialTest.ino
Created July 16, 2017 05:10
testing Arduino serial interaction
const int TESTPIN = 11;
String label = "Tick";
char buffer[33];
void setup() {
// put your setup code here, to run once:
pinMode(TESTPIN, OUTPUT);
Serial.begin(9600);
}
#include <YMZ294.h>
#include <Wire.h>
#define ADDR_FREQ_A CH_A
#define ADDR_FREQ_B CH_B
#define ADDR_FREQ_C CH_C
// Output Pins
const byte WRCS_PIN = 8;
const byte A0_PIN = 9;
@yandod
yandod / feedtech_fb.md
Last active September 8, 2016 02:24
FeedTech2016 FB リンク集
http://pub7.radiotunes.com:80/radiotunes_guitar
http://pub2.radiotunes.com:80/radiotunes_solopiano
http://pub3.radiotunes.com:80/radiotunes_smoothjazz247
http://pub4.radiotunes.com:80/radiotunes_smoothjazz
http://pub5.radiotunes.com:80/radiotunes_mellowjazz
http://pub6.radiotunes.com:80/radiotunes_datempolounge
http://pub2.radiotunes.com:80/radiotunes_guitar
http://pub3.radiotunes.com:80/radiotunes_solopiano
http://pub4.radiotunes.com:80/radiotunes_smoothjazz247
http://pub5.radiotunes.com:80/radiotunes_smoothjazz
@yandod
yandod / gist:7984785
Created December 16, 2013 10:09
c3.large on Engine Yard
$ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 15G 4.5G 9.6G 32% /
/dev/root 15G 4.5G 9.6G 32% /
tmpfs 1.9G 220K 1.9G 1% /run
udev 10M 0 10M 0% /dev
shm 1.9G 0 1.9G 0% /dev/shm
cgroup_root 10M 0 10M 0% /sys/fs/cgroup
/dev/xvdb 16G 170M 15G 2% /mnt
/dev/xvdz1 15G 242M 14G 2% /data
create table users (
id integer auto_increment,
username text,
password text,
role text,
created datetime,
modified datetime,
primary key (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
@yandod
yandod / cake upgrade
Created November 26, 2013 13:56
CakePHP3 upgrade shell
vagrant@precise64:/vagrant_data/App$ ./Console/cake upgrade
A shell to help automate upgrading from CakePHP 3.0 to 2.x.
Be sure to
have a backup of your application before running these commands.
Usage:
cake upgrade [subcommand] [-h] [-v] [-q]
Subcommands:
@yandod
yandod / Vagrantfile
Created November 7, 2013 15:53
Single file Vagrntfile which spin up Ubuntu 12.04 + PHP5.5 + Nginx + MySQL
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
src_dir = './'
doc_root = '/vagrant_data/webroot'
app_name = File.basename(File.dirname(__FILE__))
config.vm.network :forwarded_port, guest: 80, host: 8080
@yandod
yandod / rand.sh
Created October 28, 2013 11:12
random
ls | grep key | php -r '$list=array(); while($l = trim(fgets(STDIN))){$list[]=$l;} echo "\n"; echo $list[array_rand($list)] ."\n";'