Skip to content

Instantly share code, notes, and snippets.

View arvola's full-sized avatar

Mikael Arvola arvola

View GitHub Profile
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
$links = array(
'foo' => 'http://bar.com/foo01,
'baz' => 'http://bam.com/baz01
);
$uri = $_SERVER['REQUEST_URI'];
$forward = $links[$uri];
header("Location: $forward");
@arvola
arvola / gist:1117bc597e6efb8e0b0e
Last active August 29, 2015 14:04
pegdown-doclet two code blocks
/**
* This is a test that fails.
*
* ```java
* public class Foo {
* private Object object;
* }
* ```
*
--- interface/lib/classes/remoting_lib.inc.php (revision 3962)
+++ interface/lib/classes/remoting_lib.inc.php (working copy)
@@ -817,11 +817,11 @@
if(@is_numeric($primary_id)) {
$sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$this->formDef['db_table_idx']." = ".$primary_id;
return $app->db->queryOneRecord($sql);
- } elseif (@is_array($primary_id)) {
+ } elseif (@is_array($primary_id) || @is_object($primary_id)) {
$sql_offset = 0;
$sql_limit = 0;