Skip to content

Instantly share code, notes, and snippets.

View sime's full-sized avatar
🔒
Trezor

Simon Males sime

🔒
Trezor
View GitHub Profile
@sime
sime / photo_saved.txt
Last active December 27, 2015 23:49
Nexus 4. PhoneGap + AngularJS failing on two way binding.
I/WindowManager( 511): Screenshot Window{41e90238 u0 com.google.android.gallery3d/com.android.camera.CameraActivity} was all black! mSurfaceLayer=21100 minLayer=21100 maxLayer=21100
V/CAM_PhotoModule(31599): stopPreview
E/mm-libcamera2( 174): PROFILE HAL: stopPreview(): E: 1384150355.605338095
E/mm-camera( 208): config_MSG_ID_STOP_ACK: streamon_mask is not clear. Should not call PP_Release_HW
D/LocationManager(31599): stopReceivingLocationUpdates
E/mm-libcamera2( 174): PROFILE HAL: stopPreview(): E: 1384150355.614890971
E/QCameraHWI( 174): android::status_t android::QCameraHardwareInterface::setPreviewWindow(preview_stream_ops_t*):Received Setting NULL preview window
E/QCameraHWI( 174): android::status_t android::QCameraHardwareInterface::setPreviewWindow(preview_stream_ops_t*): mPreviewWindow = 0x0x0, mStreamDisplay = 0x0xb8d2cc98
W/QCameraHWI_Preview( 174): Setting NULL preview window
I/CameraClient( 174): Destroying camera 1
@sime
sime / _full_reveal.scss
Created September 16, 2013 08:20
Full screen Reveal in Foundation 4.3.1 on small screens I think modals (i.e. Reveal) are broken on small screens when they contain a form. I've introduced a new class 'full-on-small' which will expand modals to 100% width on small screens. This is a drop in solution, I've also attempted to solve this in a different manner upstream: https://githu…
@media screen and (max-width: $small-screen) {
.#{$reveal-modal-class} {
&.full-on-small {
top: 0;
margin-#{$default-float}: 0;
#{$default-float}: 0;
width: 100%;
}
}
}
@sime
sime / learn2013.md
Last active December 18, 2015 23:49
I things I want to learn
  • AngularJS
  • PhoneGap
default:
paths:
features: ../../features
extensions:
Behat\MinkExtension\Extension:
base_url: 'http://test.localhost:8080/'
goutte:
guzzle_parameters:
request.params:
redirect.disable: true
@sime
sime / callout.js
Created May 8, 2013 03:54
Attempting to $.extend Foundation.libs.tooltips,
var callout = {
create : 'overwritten object'
};
$.extend(true, callout, Foundation.libs.tooltips);
if (typeof callout.create == 'function') {
alert('create() is still a function!');
}
if (typeof callout.create == 'string') {
@sime
sime / migration.php
Created April 19, 2013 10:26
Migrating from string to integer primary keys in CakePHP
<?php
App::uses('AppShell', 'Console/Command');
class UserIdFromVarcharToInt extends CakeMigration {
public $description = '';
public $migration = array(
'up' => array(
'alter_field' => array(
'users' => array(
@sime
sime / gist:5079460
Last active December 14, 2015 11:28
Activemerchant requires older version of builder, which conflicts which activemodel?
$ ruby main.rb
/opt/local/lib/ruby1.9/1.9.1/rubygems/specification.rb:1637:in `raise_if_conflicts': Unable to activate activemodel-3.2.12, because builder-3.2.0 conflicts with builder (~> 3.0.0) (Gem::LoadError)
from /opt/local/lib/ruby1.9/1.9.1/rubygems/specification.rb:746:in `activate'
from /opt/local/lib/ruby1.9/1.9.1/rubygems/specification.rb:780:in `block in activate_dependencies'
from /opt/local/lib/ruby1.9/1.9.1/rubygems/specification.rb:766:in `each'
from /opt/local/lib/ruby1.9/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
from /opt/local/lib/ruby1.9/1.9.1/rubygems/specification.rb:750:in `activate'
from /opt/local/lib/ruby1.9/1.9.1/rubygems/custom_require.rb:51:in `block in require'
from /opt/local/lib/ruby1.9/1.9.1/rubygems/custom_require.rb:50:in `each'
from /opt/local/lib/ruby1.9/1.9.1/rubygems/custom_require.rb:50:in `require'
@sime
sime / core.php
Last active December 12, 2015 08:39
When running CakePHP on Heroku, by default you'll see file permission errors. The Heroku filesystem is read-only, but '/tmp' and '/log' are writable. To remove the errors update Config::config() in core.php
<?php
// Heroku Read-only Filesystem https://devcenter.heroku.com/articles/read-only-filesystem
/**
* Configure the cache used for general framework caching. Path information,
* object listings, and translation cache files are stored with this configuration.
*/
Cache::config('_cake_core_', array(
'engine' => $engine,
'prefix' => $prefix . 'cake_core_',
@sime
sime / gist:4490017
Created January 9, 2013 02:23
Build native MySQL gem extension when using MacPorts
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/opt/local/lib/mysql55/bin/mysql_config
@sime
sime / canidothisbetter.rb
Created October 24, 2012 10:01
Am I this this in a nicer way?
if employee_skills.has_key?(skill_name) then
employee_skills[skill_name] += 1
else
employee_skills[skill_name] = 1
end