Skip to content

Instantly share code, notes, and snippets.

View crishoj's full-sized avatar

Christian Rishøj crishoj

View GitHub Profile
Index: error/Hoptoad.php
===================================================================
--- error/Hoptoad.php (revision 2525)
+++ error/Hoptoad.php (working copy)
@@ -245,6 +245,8 @@
$node = $parent->addChild($key);
foreach ($source as $key => $val) {
+ if (is_array($val))
+ $val = str_replace("\n", ' ', print_r($val, true));
Index: include/error/Hoptoad.php
===================================================================
--- include/error/Hoptoad.php (revision 2530)
+++ include/error/Hoptoad.php (working copy)
@@ -268,8 +268,8 @@
if (isset($entry['class']) && $entry['class'] == 'Services_Hoptoad') continue;
$line_node = $backtrace->addChild('line');
- $line_node->addAttribute('file', $entry['file']);
- $line_node->addAttribute('number', $entry['line']);
@@ -248,5 +248,5 @@
if (is_array($val))
$val = str_replace("\n", ' ', print_r($val, true));
- $var_node = $node->addChild('var', $val);
+ $var_node = $node->addChild('var', htmlspecialchars($val));
$var_node->addAttribute('key', $key);
}
Index: ProgramGLSL.cpp
===================================================================
--- src/SiftGPU/ProgramGLSL.cpp (revision 400)
+++ src/SiftGPU/ProgramGLSL.cpp (working copy)
@@ -458,7 +458,7 @@
{
out<<"coord = gl_TexCoord[0].xy + vec2(float("<<i-nhpixel<<"),0);\n";
out<<"pc=texture2DRect(tex, coord);\n";
- if(GlobalUtil::_PreciseBorder) out<<"if(coord.x < 0) pc = pc.rrbb;\n";
+ if(GlobalUtil::_PreciseBorder) out<<"if(coord.x < 0.0) pc = pc.rrbb;\n";
@crishoj
crishoj / makefile.patch
Created May 31, 2012 07:52
SiftGPU Mac OS X makefile patch
--- makefile 2012-05-31 16:13:38.000000000 +0800
+++ makefile.new 2012-05-31 16:15:44.000000000 +0800
@@ -7,7 +7,7 @@
siftgpu_enable_opencl = 0
#------------------------------------------------------------------------------------------------
# enable CUDA-based SiftGPU?
-siftgpu_enable_cuda = 1
+siftgpu_enable_cuda = 0
CUDA_INSTALL_PATH = /usr/local/cuda
#change additional settings, like SM version here if it is not 1.0 (eg. -arch sm_13 for GTX280)
desc "remotely console"
task :console, :roles => :app do
input = ''
run "cd #{current_path} && rails console #{ENV['RAILS_ENV']}" do |channel, stream, data|
next if data.chomp == input.chomp || data.chomp == ''
print data
channel.send_data(input = $stdin.gets) if data =~ /:\d{3}:\d+(\*|>)/
end
end
@crishoj
crishoj / politiken.js
Last active December 17, 2015 20:48
Virtuelt Politiken-abonnement
['teaserwrapper', 'meteroverlay'].forEach(function (id) {
document.getElementById(id).style.display = 'none' }
);
document.body.style.overflow = '';
@crishoj
crishoj / 1.png
Created February 7, 2014 19:45 — forked from jeffkreeftmeijer/1.png
1.png
@crishoj
crishoj / Iconizer.sh
Last active July 7, 2016 09:23 — forked from steverichey/Iconizer.sh
Create iOS application icons from one PDF file. Requires ImageMagick.
#!/bin/sh
#
# Iconizer shell script by Steve Richey ([email protected])
#
# This is a simple tool to generate all necessary app icon sizes and the JSON file for an *EXISTING* Xcode project from one file.
# To use: specify the path to your vector graphic (PDF format) and the path to your Xcode folder containing Images.xcassets
# Example: sh iconizer.sh MyVectorGraphic.pdf MyXcodeProject
#
# Requires ImageMagick: http://www.imagemagick.org/
@crishoj
crishoj / CamelCasedModel.php
Last active March 31, 2016 10:29
Eloquent base model for schemas with camel-cased tables and fields
<?php
namespace app;
use Illuminate\Database\Eloquent\Model;
class CamelCasedModel extends Model
{
public function getForeignKey()