Skip to content

Instantly share code, notes, and snippets.

View SeanJA's full-sized avatar
🦑
🦖

SeanJA SeanJA

🦑
🦖
View GitHub Profile
@SeanJA
SeanJA / gist:3041858
Created July 3, 2012 18:49
drupal equivalent
SELECT COUNT(*)
FROM table_1
JOIN table_2 ON (table_1.id=table_2.table_1_id)
WHERE table_1.column != 'foo'
<?php
//query_builder
$q = new query($db);
$q->column('COUNT(*)')
@SeanJA
SeanJA / gist:2953803
Created June 19, 2012 12:10
npm is no ok
C:\Users\Sean\Dropbox\nodejs\node_modules\sqlite3\build\deps\sqlite3\sqlite3.vcxproj(1,682): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
ERR! Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
at ChildProcess.onExit (C:\Users\Sean\Dropbox\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:209:23)
at ChildProcess.emit (events.js:70:17)
at maybeExit (child_process.js:362:16)
at Process.onexit (child_process.js:398:5)
ERR! not ok
npm ERR! sqlite3@2.1.3 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
@SeanJA
SeanJA / 1.json
Created June 18, 2012 04:17
a simple json file migration for the drupal 7 (maybe 6?) migrate module
{
"title": "this is a title",
"content": "this is a body",
"date": "2009-01-01",
"url":"http://oldsite.com/123/test",
"image": "test.jpg",
"id": 1
}
@SeanJA
SeanJA / tables.html
Created June 15, 2012 18:44
AHHHHHHH
<html>
<head>
<title>
Yo dawg, I heard you like tables
</title>
</head>
<body>
<table>
@SeanJA
SeanJA / php.sublime-build
Created May 16, 2012 19:51
php.sublime-build
{
"cmd": ["php", "-f", "$file"],
/* what is this for? */
"file_regex": ".* in (.*?) on line ([0-9]*)",
"selector": "source.php"
}
@SeanJA
SeanJA / gist:2637382
Created May 8, 2012 17:05
most useless fucking error ever

Thanks a lot exact target for this helpful error:

Unable to generate preview:
A_SCRIPTINGA scripting error has occurred.
An error occurred when attempting to parse HtmlEmailBody content for HTML content.
MemberID: 1234151
JobID: 0
ListID: 123423

Content Begins With: %%[

#ffs don't do this
for i in 1..10
if i == 1
next #continue
else
#do stuff
end
end
@SeanJA
SeanJA / tweets-to-image.php
Created May 1, 2012 19:45
Turn your twitter avatar into your tweets (with the colour and stuff...)
<?php
$username = 'seanja';
if (!file_exists('cache')) {
mkdir('cache', $mode = 0777);
}
if (!file_exists('cache')) {
die('couldn\'t make a cache folder, make one yourself called "cache" in the same dir as this file.');
}
@SeanJA
SeanJA / jquery.proxy.js
Created March 22, 2012 12:59
jquery.proxy.js
if(typeof jQuery.proxy === 'undefined'){
jQuery.extend({
proxy : function( fn, proxy, thisObject ) {
if ( arguments.length === 2 ) {
if ( typeof proxy === "string" ) {
thisObject = fn;
fn = thisObject[ proxy ];
proxy = undefined;
} else if ( proxy && !jQuery.isFunction( proxy ) ) {
@SeanJA
SeanJA / JSDebug.php
Created September 30, 2011 16:01
debugging in the console from php
<?php
/**
* @method void error() error(string $name, mixed $var)
* @method void exception() exception(string $name, mixed $var)
* @method void info() info(string $name, mixed $var)
* @method void log() log(string $name, mixed $var)
* @method void trace() trace(string $name, mixed $var)
* @method void warn() warn(string $name, mixed $var)