Skip to content

Instantly share code, notes, and snippets.

Alex Kirk akirk

Block or report user

Report or block akirk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@akirk
akirk / .profile
Created Feb 26, 2013
except from my ~/.profile . i use this all the time!
View .profile
# change directory to the currently open finder window.
cdf () {
currFolderPath=$( /usr/bin/osascript << EOT
tell application "Finder"
try
set currFolder to (folder of the front window as alias)
on error
set currFolder to (path to desktop folder as alias)
end try
POSIX path of currFolder
@akirk
akirk / gist:5243828
Last active Dec 15, 2015
Petitionsunterschriften Wien
View gist:5243828
<?php
echo getNumberOfPetitionSignatures("446def6e128c4f199ddfdce70c599775"), "\n";
// oder
echo getNumberOfPetitionSignaturesCached("446def6e128c4f199ddfdce70c599775"), "\n";
function getNumberOfPetitionSignaturesCached($id) {
// aktuelles Verzeichnis muss schreibbar sein, sonst Pfad ändern
$cache = __DIR__ . "/unterschriften-$id.txt";
@akirk
akirk / qtranslate_core.php.diff
Last active Aug 29, 2015
Proper fix for qTranslate plugin for Wordpress 3.9
View qtranslate_core.php.diff
diff --git i/public/wp-content/plugins/qtranslate/qtranslate_core.php w/public/wp-content/plugins/qtranslate/qtranslate_core.php
index 17b4669..b4c49cf 100644
--- i/public/wp-content/plugins/qtranslate/qtranslate_core.php
+++ w/public/wp-content/plugins/qtranslate/qtranslate_core.php
@@ -455,9 +455,9 @@ function qtrans_strftime($format, $date, $default = '', $before = '', $after = '
return $before.strftime($format, $date).$after;
}
-function qtrans_dateFromPostForCurrentLanguage($old_date, $format ='', $before = '', $after = '') {
+function qtrans_dateFromPostForCurrentLanguage($old_date, $format ='') {
View tolerance-test.html
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript">
var I18n = {
l: function() {}
};
</script>
View cross-locale-pte.php
<?php
/**
* Plugin Name: Cross-Locale PTE
* Plugin URI: https://meta.trac.wordpress.org/ticket/2000
* Description: Implements a user that can approve and import translations in all
* translation-sets of a project but cannot overwrite current translations by others.
*/
class CrossLocalePTE {
public static function init() {
View cross-locale-pte.php
<?php
/**
* Plugin Name: Cross-Locale PTE
* Plugin URI: https://meta.trac.wordpress.org/ticket/2000
* Description: Implements a user that can approve and import translations in all
* translation-sets of a project but cannot overwrite current translations by others.
*/
// This is re-implemented in the following filter.
remove_filter( 'gp_pre_can_user', 'gp_route_translation_set_permissions_to_validator_permissions' );
You can’t perform that action at this time.