Skip to content

Instantly share code, notes, and snippets.

Avatar

Xing mikespook

View GitHub Profile
View mymysql-foobar.go
package main
import (
"log"
"database/sql"
"encoding/json"
_ "github.com/ziutek/mymysql/godrv"
)
type Dict struct {
@mikespook
mikespook / notify.go
Created Mar 21, 2012
inotify with pathes
View notify.go
package main
import (
"exp/inotify"
"log"
"os"
)
func init() {
f, _ := os.OpenFile("notify.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0644)
@mikespook
mikespook / gist:3003825
Created Jun 27, 2012
检测图片内容是否匹配
View gist:3003825
<?php
// 获得图片的采样
function samplingGif($filename) {
$sampling = array();
$img = imagecreatefromgif($filename);
$size = getimagesize($filename);
$w = $size[0];
$h = $size[1];
for($x = 0; $x < $w; $x++) {
$sampling[$x] = array();
@mikespook
mikespook / gomodule.go
Created May 6, 2013
SIGSEGV: segmentation violation PC=0xdeaddead signal arrived during cgo execution github.com/qiniu/py._Cfunc_PyImport_ExecCodeModule(0x304ca8, 0x2becc8, 0x304ca8) github.com/qiniu/py/_obj/_cgo_defun.c:547 +0x2f github.com/qiniu/py.ExecCodeModule(0x81012f8, 0x4, 0x2becc8, 0x0, 0x0, ...) github.com/qiniu/py/_obj/_cgo_gotypes.go:4120 +0x79 main.mai…
View gomodule.go
package main
import (
"fmt"
"time"
"github.com/qiniu/log"
"github.com/qiniu/py"
)
// -------------------------------------------------------------------
View issue-60.phpt
--TEST--
Check for Yaf_Controller::finalize
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--FILE--
<?php
$config = array(
"application" => array(
"directory" => realpath(dirname(__FILE__)),
"dispatcher" => array(
View gist:8ec5735344dc561e7428
package main
import (
"github.com/mikespook/golib/log"
"gopkg.in/gomail.v1"
)
func main() {
addr := "mail.awecent.com"
port := 25
@mikespook
mikespook / content
Created Jan 21, 2015
A workflow of translation projects with VCS
View content
A-Z
===
A brown fox jumped over a lazy dog.
a brown fox jumped over a lazy dog.
A brown fox jumped over a lazy dog.
A brown fox jumped over a lazy dog.
A brown fox jumped over a lazy dog.
029
@mikespook
mikespook / hello.c
Created Jul 2, 2016
GIMP Plug-in in Golang
View hello.c
// Comes from http://developer.gimp.org/writing-a-plug-in/1/hello.c
#include <libgimp/gimp.h>
static void query (void);
static void run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals);
@mikespook
mikespook / civicrm_8.x-master.patch
Created Dec 23, 2016
CiviCRM for Drupal 8 patch
View civicrm_8.x-master.patch
diff --git a/civicrm.install b/civicrm.install
index a6bbc99..2531b4c 100644
--- a/civicrm.install
+++ b/civicrm.install
@@ -60,6 +60,7 @@ function civicrm_install() {
* @param $phase
*/
function civicrm_requirements($phase) {
+# require_once DRUPAL_ROOT . "/modules/libraries/libraries.module";
$requirements = array();
@mikespook
mikespook / NTP.ino
Last active Mar 28, 2020
Sync ESP8266 board date/time with NTP
View NTP.ino
#include <time.h>
#include <TZ.h>
#include <ESP8266WiFi.h>
#include <StackThunk.h>
#include <WiFiClientSecure.h>
#include <ESP8266HTTPClient.h>
WiFiClientSecure client;
static const char digicert[] = "-----BEGIN CERTIFICATE-----\n"
"MIIHQDCCBiigAwIBAgIQD9B43Ujxor1NDyupa2A4/jANBgkqhkiG9w0BAQsFADBN\n"
You can’t perform that action at this time.