Skip to content

Instantly share code, notes, and snippets.

@axfelix
axfelix / dip-maker.sh
Last active June 22, 2023 16:42
dip-maker script
#!/bin/bash
# Requires enscript, ps2pdf, LibreOffice, pdftk
# brew install enscript ghostscript pdftk-java
# brew install --cask libreoffice
# Also, if you're on macOS, this needs gnu find
# brew install coreutils, then:
# export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
@axfelix
axfelix / gist:3f75d28627e7f564fa1d3773015ac607
Created February 3, 2023 20:09 — forked from pvieito/gist:ee6d2c8934a8f84b9aeb467585277b8a
Consumer keys of official Twitter clients

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA

import sys
import io
import csv
import re
import lxml.etree as le
class RegexDict(dict):
def get_matching(self, event):
return (self[key] for key in self if re.match(key, event))
@axfelix
axfelix / 1_Instructions.md
Created March 7, 2012 18:27 — forked from Daniel15/1_Twitter autoresponder bot.md
Twitter autoresponder bot

Twitter autoresponder bot

By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.

Could be modified to be more advanced (match regular expressions to answer questions, etc.)

<tr valign="top">
<td class="label">{fieldLabel name="managerpwd" key="plugins.auth.ldap.settings.managerpwd"}</td>
<td class="value">
<input type="password" id="managerpwd" name="settings[managerpwd]" value="{$settings.managerpwd|escape}" size="30" maxlength="255"
class="textField" />
<br />
<span class="instruct">{translate key="plugins.auth.ldap.settings.managerpwd.description"}</span>
</td>
</tr>
;Is implicit authentication enabled or not
;implicit_auth = On
;Implicit Auth Header Variables
;implicit_auth_header_first_name = HTTP_GIVENNAME
;implicit_auth_header_last_name = HTTP_SN
;implicit_auth_header_email = HTTP_MAIL
;implicit_auth_header_phone = HTTP_TELEPHONENUMBER
function authenticate($username, $password) {
$valid = false;
if ($password != null) {
if ($this->open()) {
if ($entry = $this->getUserEntry($username)) {
$userdn = ldap_get_dn($this->conn, $entry);
if ($this->bind($userdn, $password)) {
$valid = true;
}
}