Skip to content

Instantly share code, notes, and snippets.

@crot4lus
crot4lus / detect-swipes.js
Last active August 29, 2015 13:56
Detect swipes using jquery - handy for sliders etc
$this = $('.my-swipe-area');
var touch = {
start: false,
stop: false
};
$this.on('touchstart', function(e){
touch.start = e.originalEvent.touches[0].pageX;
});
/*
SublimeLinter default settings
*/
{
/*
Sets the mode in which SublimeLinter runs:
true - Linting occurs in the background as you type (the default).
false - Linting only occurs when you initiate it.
"load-save" - Linting occurs only when a file is loaded and saved.
@crot4lus
crot4lus / facebook-to-disqus.php
Created September 11, 2014 09:21
Import Facebook comments to Disqus
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dsq="http://www.disqus.com/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.0/"
>
<channel>
<?php
error_reporting(0);
<table width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
<h1 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; box-sizing: border-box; font-size: 32px; color: #fff; line-height: 1.2; font-weight: 500; margin: 40px 0 0; padding: 0;">$33.98 Paid</h1>
</td>
</tr>
<tr style="font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">
<td class="content-block" style="font-family: 'Helvetica N
Array
(
[0] => Cake\ORM\Association\BelongsTo Object
(
[_name:protected] => UserLevels
[_className:protected] =>
[_foreignKey:protected] =>
[_conditions:protected] => Array
(
)
@crot4lus
crot4lus / custom-definitions-brackets.css
Last active August 29, 2015 14:08
Theme custom definitions - brackets
/* LINE PADDING */
.CodeMirror pre{
padding: 3px 0;
line-height: 24px;
}
.CodeMirror-linenumber{
padding: 3px 10px 3px 0;
line-height: 24px;
<?php
$baseDir = dirname(dirname(__FILE__));
return [
'plugins' => [
'Bake' => $baseDir . '/vendor/cakephp/bake/',
'DebugKit' => $baseDir . '/vendor/cakephp/debug_kit/',
'Migrations' => $baseDir . '/vendor/cakephp/migrations/'
]
];
<?php
namespace App\Log\Engine;
use Cake\Log\Engine\BaseLog;
use Cake\ORM\TableRegistry;
class DataLog extends BaseLog
{
public function __construct(array $config = [])
@crot4lus
crot4lus / gist:42b147b8e52d3c94f758
Created June 25, 2015 10:36
Cake belongsToMany
Array
(
[id] => 1
[name] => Super Admin
[permissions] => Array
(
[_ids] => Array
(
[0] => 7
[1] => 6