Skip to content

Instantly share code, notes, and snippets.

@akirk
akirk / .profile
Created February 26, 2013 10:09
except from my ~/.profile . i use this all the time!
# 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 December 15, 2015 10:09
Petitionsunterschriften Wien
<?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 August 29, 2015 13:59
Proper fix for qTranslate plugin for Wordpress 3.9
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 ='') {
<!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>
<?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() {
<?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' );
@akirk
akirk / systemnavigationbar.diff
Created March 22, 2021 15:52
Attempt to change systemNavigationBarColor
diff --git i/lib/app.dart w/lib/app.dart
index 582ddff..6798a7b 100644
--- i/lib/app.dart
+++ w/lib/app.dart
@@ -5,6 +5,7 @@ import 'package:glider/models/theme_base.dart';
import 'package:glider/pages/stories_page.dart';
import 'package:glider/providers/persistence_provider.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:flutter/services.dart';
@akirk
akirk / iCal.php
Last active May 6, 2022 11:19 — forked from edewaal97/iCal.php
iCal PHP Parser
<?php
// SOURCE: https://gist.github.com/seebz/c00a38d9520e035a6a8c
class iCal
{
/**
* @var string
*/
public $title;
@akirk
akirk / blueprint.json
Last active February 14, 2024 15:59
Free My Site blueprint
{
"landingPage": "/wp-admin/",
"preferredVersions": {
"php": "8.0",
"wp": "latest"
},
"steps": [
{
"step": "login",
"username": "admin",
{
"landingPage": "/wp-admin/",
"preferredVersions": {
"php": "8.0",
"wp": "latest"
},
"steps": [
{
"step": "login",
"username": "admin",