This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function base_url() { | |
var url = window.location.href; | |
var idx = url.lastIndexOf('/'); | |
if (idx > 0) { | |
url = url.substr(0, idx); | |
} else { | |
url = ""; | |
} | |
return url; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Encode; | |
use HTTP::Request::Common; | |
use LWP::UserAgent; | |
my $ua = LWP::UserAgent->new; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove Control = Control_R | |
keysym Control_R = Super_R | |
add Control = Control_R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Return calendar for weight. | |
* @return Calendar | |
*/ | |
function getWeightCal() { | |
var id = 'YOUR GOOGLE CALENDAR ID'; | |
var cal = CalendarApp.getOwnedCalendarById(id); | |
return cal; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ru CodeIgniter_2.0.3//application/config/database.php CodeIgniter_2.1.0//application/config/database.php | |
--- CodeIgniter_2.0.3//application/config/database.php 2011-08-20 20:59:14.000000000 +0900 | |
+++ CodeIgniter_2.1.0//application/config/database.php 2011-11-01 01:15:36.000000000 +0900 | |
@@ -27,7 +27,8 @@ | |
| ['char_set'] The character set used in communicating with the database | |
| ['dbcollat'] The character collation used in communicating with the database | |
| NOTE: For MySQL and MySQLi databases, this setting is only used | |
-| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7. | |
+| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 | |
+| (and in table creation queries made with DB Forge). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use autodie; | |
sub validate_show_lines { | |
my ( $show ) = @_; | |
return @$show[0] =~ /^tag .*$/; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VIM=/usr/bin/vim | |
FILE=${1%:*} | |
LINE=${1#*:} | |
if [[ "$LINE" =~ ^[0-9]+$ ]] | |
then | |
$VIM +"$LINE" "$FILE" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv/cv.h> | |
#include <opencv/highgui.h> | |
#include <time.h> | |
// http://opencv.jp/sample/text.html | |
// gcc put_text_sample.c -o put_text_sample `pkg-config --libs --cflags opencv` && ./put_text_sample | |
int | |
main (int argc, char **argv) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
################################################################### | |
# | |
# 当スクリプトでは、以下のことを行う。 | |
# | |
# 1./etc/apache2/site-available, /etc/apache2/site-enabledへの | |
# VirtualHostの設定を記述したファイルを設置 | |
# 2./var/log/apache2に指定したドメインのディレクトリを作成 | |
# 3./etc/hostsに指定したドメインを追加 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *dir = [paths objectAtIndex:0]; | |
NSLog(@"dir=%@", dir); | |
NSString *filePath = [dir stringByAppendingPathComponent:@"hoge.flv"]; | |
NSLog(@"filePath=%@", filePath); | |
NSFileManager *fm = [NSFileManager defaultManager]; | |
BOOL exists = [fm fileExistsAtPath:filePath isDirectory:NO]; | |
BOOL writable = [fm isWritableFileAtPath:filePath]; | |
BOOL readable = [fm isReadableFileAtPath:filePath]; |