Skip to content

Instantly share code, notes, and snippets.

commit 52a710098090c132181164544b00b1ba4e02ab9d
Author: Jimmy Berry <[email protected]>
Date: Wed Apr 13 10:30:24 2011 -0500
#945512: Drupal 7 port.
diff --git pathfilter.info pathfilter.info
index 6961d5b..fa9fce6 100644
--- pathfilter.info
+++ pathfilter.info
commit 2c11d6558fb23488cb7b8652267eb561bee85fdd
Author: Jimmy Berry <[email protected]>
Date: Sun May 22 06:23:07 2011 -0500
Patch #1153072: Admin role doesn't provide all permissions.
diff --git modules/user/user.module modules/user/user.module
index 90d313b..000f70e 100644
--- modules/user/user.module
+++ modules/user/user.module
diff --git modules/field/modules/list/list.module modules/field/modules/list/list.module
index 608679b..2518ebc 100644
--- modules/field/modules/list/list.module
+++ modules/field/modules/list/list.module
@@ -343,7 +343,7 @@ function list_allowed_values_string($values) {
function list_field_update_forbid($field, $prior_field, $has_data) {
if ($field['module'] == 'list' && $has_data) {
// Forbid any update that removes allowed values with actual data.
- $lost_keys = array_diff(array_keys($field['settings']['allowed_values']), array_keys($prior_field['settings']['allowed_values']));
+ $lost_keys = array_diff(array_keys($prior_field['settings']['allowed_values']), array_keys($field['settings']['allowed_values']));
@boombatower
boombatower / upload.php
Created September 12, 2013 20:46
Simple GAE upload example.
<?php
ini_set('display_errors', TRUE);
const BUCKET = 'boombatower-drupal.appspot.com';
$file_name = 'gs://' . BUCKET . '/new_file.txt';
$some_text = !empty($_POST['some_text']) ? $_POST['some_text'] : '';
require_once 'google/appengine/api/cloud_storage/CloudStorageTools.php';
use google\appengine\api\cloud_storage\CloudStorageTools;
@boombatower
boombatower / memcache-compressed.patch
Created November 15, 2013 06:23
Define MEMCACHE_COMPRESSED constant to work around lack of one on appengine.
From b8bf0b19ee743212e4745cebdd7975999d1ae2b5 Mon Sep 17 00:00:00 2001
From: boombatower <[email protected]>
Date: Tue, 12 Nov 2013 15:30:09 -0800
Subject: [PATCH] Define MEMCACHE_COMPRESSED constant to work around lack of
one on appengine.
To be fixed in upcoming release.
---
memcache.inc | 1 +
1 file changed, 1 insertion(+)
@boombatower
boombatower / zypper-diff.diff
Created October 16, 2014 16:37
mmckeen/opensuse-13-1 vs opensuse:13.1 package summary
--- zypper-failing 2014-09-16 15:16:36.305302315 -0500
+++ zypper-working 2014-09-16 15:15:09.516495775 -0500
@@ -3,26 +3,36 @@
S | Name | Summary | Type
--+------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------
+i | aaa_base | openSUSE Base Package | package
+i | aaa_base-extras | SUSE Linux Base Package (recommended part) | package
+i | adjtimex | Kernel time variables configuration utility | package
+i | augeas-lenses
@boombatower
boombatower / Dockerfile
Last active January 30, 2020 16:29
obs-studio build dockerfile
FROM boombatower/opensuse
RUN zypper addrepo --no-gpgcheck \
http://packman.inode.at/suse/openSUSE_13.2/ packman && \
zypper mr -p 20 packman && \
zypper refresh
RUN zypper --non-interactive install --no-recommends \
cmake \
fontconfig-devel \
@boombatower
boombatower / download.php
Created September 27, 2015 05:15
Web scraper for vbulletin. Create pdf of pages and whole thread and downloads all attached images.
<?php
const BASE = '';
const COUNT = 1;
$pages = [];
for ($i = 1; $i <= COUNT; $i++) {
$suffix = $i > 1 ? '/page' . $i : '';
$pages[] = $page = 'page' . $i . '.pdf';
$url = BASE . $suffix;
@boombatower
boombatower / g710+-leds.php
Created November 9, 2015 06:02
Cycle all leds on Logitech g710+ keyboard (demo: https://www.youtube.com/watch?v=XGil25Uhe_o)
<?php
while (true) {
for ($wasd = 0; $wasd < 5; $wasd++) {
for ($other = 0; $other < 5; $other++) {
file_put_contents('/sys/bus/hid/devices/0003:046D:C24D.0002/logitech-g710/led_keys', $wasd << 4 | $other);
usleep(100000);
}
}
diff working copy against last commited version
Index: php5-pear-channel-doctrine.spec
===================================================================
--- php5-pear-channel-doctrine.spec (revision 1045b4b8fccebfa0b1801f45c66d3d3b)
+++ php5-pear-channel-doctrine.spec (working copy)
@@ -11,8 +11,8 @@
Source0: http://pear.doctrine-project.org/channel.xml
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch