Skip to content

Instantly share code, notes, and snippets.

@almirage
almirage / check_dir_growth
Created April 5, 2018 12:50
特定のディレクトリに最新ファイルが存在するかをチェックするNagios向けのPerlスクリプトです。
#!/usr/bin/perl
$dirName = shift(@ARGV);
$okLimit = shift(@ARGV);
$warnLimit = shift(@ARGV);
if (!defined($dirName)) {
print ("ERROR: usage [dirname] [ok limit] [warn limit]\n");
exit 3;
}
@almirage
almirage / ImageAnimation.cs
Last active May 24, 2024 08:29
Sprite animation for UI.Image on Unity
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class ImageAnimation : MonoBehaviour {
public Sprite[] sprites;
public int spritePerFrame = 6;
public bool loop = true;
public bool destroyOnEnd = false;
package almirage
import org.scalatest.selenium._
import org.scalatest._
import selenium._
import org.openqa.selenium._
import htmlunit._
class IntegrationSpec extends FlatSpec with ShouldMatchers with WebBrowser {
NSArray *permissions =
[NSArray arrayWithObjects:@"publish_actions", nil];
// SDKからWarning出るけどこれをやる必要がある
[FBSession openActiveSessionWithPublishPermissions:permissions
defaultAudience:FBSessionDefaultAudienceEveryone
allowLoginUI:YES
completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
if (error) {
// something...
} else if (FB_ISSESSIONOPENWITHSTATE(status)) {
diff -u wp-includes/comment-template.php.org wp-includes/comment-template.php
@@ -1168,6 +1168,7 @@
$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
$result = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n";
$result .= "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n";
+ $result .= "<script type='text/javascript'>document.write('<');document.write('input type=\"hidden\" name=\"comment_token\" value=\"ok\" />');</script>\n";
return apply_filters('comment_id_fields', $result, $id, $replytoid);
}
diff -u wp-comments-post.php.org wp-comments-post.php