Skip to content

Instantly share code, notes, and snippets.

diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re
index 74d9ea3..04f7cbc 100644
--- a/ext/date/lib/parse_date.re
+++ b/ext/date/lib/parse_date.re
@@ -863,6 +863,7 @@ year = [0-9]{1,4};
year2 = [0-9]{2};
year4 = [0-9]{4};
year4withsign = [+-]? [0-9]{4};
+yearx = [+-]? [0-9]{5,};
@adsr
adsr / x
Created August 10, 2017 15:53
datadir="/var/lib/proxysql"
admin_variables=
{
mysql_ifaces="0.0.0.0:6032"
}
mysql_variables=
{
interfaces="0.0.0.0:3306"
@adsr
adsr / -
Created August 29, 2017 21:58
dGVzdHMvdG1wLy5nbnVwZy8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAwMDA3MDAAMDAwMTc1
MAAwMDAxNzUwADAwMDAwMDAwMDAwADEzMTUxMzYxNDQwADAxMjU3MAAgNQAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB1c3RhciAgAGFkYW0AAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAYWRhbQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0
ZXN0cy90bXAvLmdudXBnL3RydXN0ZGIuZ3BnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@adsr
adsr / foo.diff
Created October 21, 2017 20:10
diff --git a/server/config.c b/server/config.c
index 7c7a1e0033..754152b86b 100644
--- a/server/config.c
+++ b/server/config.c
@@ -45,37 +45,42 @@
#include "http_protocol.h"
#include "http_core.h"
#include "http_log.h" /* for errors in parse_htaccess */
#include "http_request.h" /* for default_handler (see invoke_handler) */
#include "http_main.h"
diff --git a/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlConnectorTask.java b/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlConnectorTask.java
index f3fc710..e9cb546 100644
--- a/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlConnectorTask.java
+++ b/debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/MySqlConnectorTask.java
@@ -60,41 +60,43 @@ public synchronized void start(Map<String, String> props) {
throw new ConnectException("Error configuring an instance of " + getClass().getSimpleName() + "; check the logs for details");
}
// Create and start the task context ...
this.taskContext = new MySqlTaskContext(config);
diff --git a/Makefile b/Makefile
index 28c6009..38954d7 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,11 @@ PCRE_LDLIBS ?= -lpcre
LDLIBS ?=
LDLIBS += $(PCRE_LDLIBS)
+SONAME := -soname
+ifeq ($(shell uname -s),Darwin)
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <zend_API.h>
#include <sys/uio.h>
/*
adam@asx1c3:~/tmp$ gcc -Wall -g $(php-config --includes) phpfunc.c -o phpfunc
adam@asx1c3:~/tmp$ php -r 'sleep(9999);' &
[1] 23436
diff --git a/src/plugins/php/weechat-php-api.c b/src/plugins/php/weechat-php-api.c
index 19012db25..6840cce99 100644
--- a/src/plugins/php/weechat-php-api.c
+++ b/src/plugins/php/weechat-php-api.c
@@ -63,39 +63,47 @@
}
#define API_PTR2STR(__pointer) \
plugin_script_ptr2str (__pointer)
#define API_STR2PTR(__string) \
plugin_script_str2ptr (weechat_php_plugin, \
@adsr
adsr / Getting Slack Tokens.md
Created April 16, 2018 02:03
Getting Slack Tokens

It is not straight forward to get a token with Slack. The expectation is that you write an OAuth client to get the token, but it is possible to get it manually. These are the steps I followed:

You should already have an account and a channel set up that you want to send error messages to.

  1. Create a new Slack App - https://api.slack.com/applications/new which will give you a client_id and a client_secret which you need for step two. You will need to enter a redirect URI, which can be any page for this purpose.
  2. Got to https://slack.com/oauth/authorize?client_id=[client_id]&scope=chat:write:bot
  3. Authorise App on the page that is returned.
  4. From the URI copy the code that is returned.
  5. Go to https://sla
<?php
class 😋{
function __construct() {
echo __CLASS__;
}
}
$face = new 😋();