Skip to content

Instantly share code, notes, and snippets.

View ChrisWillerton's full-sized avatar

Chris Willerton ChrisWillerton

View GitHub Profile
@ChrisWillerton
ChrisWillerton / todoist-link.js
Last active August 15, 2018 12:38
Bookmarklet which converts the current URL into a snippet to paste into a Todoist task. It adds a linked up magnifying glass emoji to the task which will link to the resource i.e. a Trello card. Just paste it in after your task name/comments when adding a new task.
// Paste the below into a browser bookmarklet
javascript: (function(){ prompt('Have some Latin pal: ', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'); })();
@ChrisWillerton
ChrisWillerton / getsql.php
Created November 18, 2016 09:20
Laravel Get SQL
function getSql($query)
{
$sql = $query->toSql();
$bindings = $query->getBindings();
$count = count($bindings);
while ($count > 0)
{
$count--;
$sql = preg_replace('/\?/', array_shift($bindings), $sql, 1);
@ChrisWillerton
ChrisWillerton / clog.sublime-snippet
Created March 31, 2014 10:01
Sublime snippet for console.log
<snippet>
<content><![CDATA[console.log($1);]]></content>
<tabTrigger>clog</tabTrigger>
<description>Shorthand for console.log();</description>
</snippet>