Skip to content

Instantly share code, notes, and snippets.

View jonnybarnes's full-sized avatar
:octocat:

Jonny Barnes jonnybarnes

:octocat:
View GitHub Profile
@jonnybarnes
jonnybarnes / gist:1600189
Created January 12, 2012 12:17
my .htaccess
RewriteRule ^view(/)?$ index.php?action=view
RewriteRule ^view/([a-z]+)(/)?$ index.php?action=view&cat=$1
RewriteRule ^tagcloud(/)?$ index.php?action=tagcloud
RewriteRule ^about(/)?$ index.php?action=about
RewriteRule ^register(/)?$ index.php?action=register
RewriteRule ^searchtags(/)?$ index.php?action=searchtags
RewriteRule ^searchtags/([\.a-zA-Z]+)(/)?$ index.php?action=searchtags&tag=$1
RewriteRule ^blog/feed(/)?$ rss.php
@jonnybarnes
jonnybarnes / gist:1621755
Created January 16, 2012 16:53
aptitude install error
jonny@ve:~$ sudo aptitude reinstall libssl0.9.8
The following packages will be REINSTALLED:
libssl0.9.8
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/998 kB of archives. After unpacking 0 B will be used.
Preconfiguring packages ...
Can't exec "/tmp/libssl0.9.8.config.60361": Permission denied at /usr/share/perl/5.10/IPC/Open3.pm line 168.
open2: exec of /tmp/libssl0.9.8.config.60361 configure 0.9.8o-4squeeze5 failed at /usr/share/perl5/Debconf/ConfModule.pm line 59
libssl0.9.8 failed to preconfigure, with exit status 255
(Reading database ... 28164 files and directories currently installed.)
@jonnybarnes
jonnybarnes / gist:5205576
Created March 20, 2013 15:24
error.log from owncloud with nginx
2013/03/20 15:14:14 [notice] 1439#0: *17 "^/caldav(.*)$" does not match "/", client: m.y.i.p, server: cloud.example.com, request: "GET / HTTP/1.1Mr", host: "cloud.example.com"
2013/03/20 15:14:14 [notice] 1439#0: *17 "^/carddav(.*)$" does not match "/", client: m.y.i.p, server: cloud.example.com, request: "GET / HTTP/1.1Mr", host: "cloud.example.com"
2013/03/20 15:14:14 [notice] 1439#0: *17 "^/webdav(.*)$" does not match "/", client: m.y.i.p, server: cloud.example.com, request: "GET / HTTP/1.1Mr", host: "cloud.example.com"
2013/03/20 15:14:14 [notice] 1439#0: *17 "^/.well-known/carddav" does not match "/", client: m.y.i.p, server: cloud.example.com, request: "GET / HTTP/1.1Mr", host: "cloud.example.com"
2013/03/20 15:14:14 [notice] 1439#0: *17 "^/.well-known/caldav" does not match "/", client: m.y.i.p, server: cloud.example.com, request: "GET / HTTP/1.1Mr", host: "cloud.example.com"
2013/03/20 15:14:14 [notice] 1439#0: *17 "^(/core/doc/[^\/]+/)$" does not match "/", client: m.y.i.p, server: cloud.example
@jonnybarnes
jonnybarnes / utf-8-hex-dump.php
Last active December 25, 2015 08:59
UTF-8 hex dumper
<?php
/***
Single byte chracters range 0000000 - 01111111 -- 00 - 7F
Double byte character range 1100000 - 11011111 -- C0 - DF
Triple byte character range 1110000 - 11101111 -- E0 - EF
Quadru byte character range 1111000 - 11110111 -- F0 - F7
Traili byte character range 1000000 - 10111111 -- 80 - BF
<?php
//set page value
if(isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = 1;
}
//create pdo
@jonnybarnes
jonnybarnes / gist:7666556
Created November 26, 2013 21:27
Bundesliga kits
<record>
<!-- resource manager options -->
<!-- dont preload anything in this folder -->
<boolean id="preload" value="false"/>
<!-- turn off auto mapping -->
<boolean id="amap" value="false"/>
<!-- logo mappings -->
@jonnybarnes
jonnybarnes / gist:7820805
Last active December 30, 2015 11:09
MySQL Foreign Keys

There are several ways to list foreign keys in MySQL.

Firstly:

select 
    concat(table_name, '.', column_name) as 'foreign key',  
    concat(referenced_table_name, '.', referenced_column_name) as 'references'
from
 information_schema.key_column_usage
1234567890123456789012345678901234567890123456789012345678901234567890
https://duckduckgo.com/?q=how+much+wood+could+a+wood-chuck+chuck+if+a+wood-chuck+could+chuck+wood
Some more discombobu… <LINK TO ORIG HERE>
<?php
public function indieauth()
{
if(Input::get('token')) {
var_dump('has_token'); die(); //this is added for debugging
$token = Input::get('token');
$url = 'verify?token=' . $token;
$guzzle = new Client('https://indieauth.com');
$request = $guzzle->get($url);
$repsonse = $request->send();
@jonnybarnes
jonnybarnes / indieauth-foobar-dev
Created January 24, 2014 19:07
HTTP Headers for a failed indieauth session
https://indieauth.com/auth/start?me=https%3A%2F%2Fjonnybarnes.net&profile=https%3A%2F%2Fplus.google.com%2F117317270900655269082&redirect_uri=https%3A%2F%2Ffoobar.dev%2Fauth
GET /auth/start?me=https%3A%2F%2Fjonnybarnes.net&profile=https%3A%2F%2Fplus.google.com%2F117317270900655269082&redirect_uri=https%3A%2F%2Ffoobar.dev%2Fauth HTTP/1.1
Host: indieauth.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:26.0) Gecko/20100101 Firefox/26.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Referer: https://indieauth.com/auth?me=https%3A%2F%2Fjonnybarnes.net&redirect_uri=https%3A%2F%2Ffoobar.dev%2Fauth