This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= Modify: django.core.management.commands.inspectdb | |
- line 33, add | |
- cursor.execute("SET search_path TO myschema") | |
- line 80, change to | |
- field_type = 'ForeignKey(\'%s\'' % rel_to | |
- now you can ignore the model ordering | |
= Modify: django.db.backends.postgres_psycopg2.base | |
- line 147, add | |
- cursor.execute("SET search_path TO myschema") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Expands to set self.frame.origin | |
#define UIViewOrigin(X, Y) ({ \ | |
CGRect frame = self.frame; \ | |
frame.origin = CGPointMake(X, Y); \ | |
self.frame = frame; }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Created by Christopher Bess | |
# svn2git (https://github.com/nirvdrum/svn2git) helper script | |
# working directory (holds local git repos) | |
DIR=tmp | |
# the svn repo to convert | |
SVN_URL=https://svn.example.com/example | |
# the url to the git repo | |
[email protected]:git/example.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sets the view's background to the given image | |
static void SetBackgroundImage(UIView *view, NSString *imageName) | |
{ | |
view.layer.contents = (id)[UIImage imageNamed:imageName].CGImage; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sets the view's background to the given image | |
// prior to call, you may need to execute: `view.wantsLayer = YES` | |
void SetBackgroundImage(NSView *view, NSString *imageName) | |
{ | |
view.layer.contents = (id)[NSImage imageNamed:imageName]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update_model(model, save_update=True, **kwargs): | |
"""Updates the specified model instance using the keyword arguments as the model | |
property attributes and values. | |
Example usage: | |
update_model(mymodel, save_update=True, **some_dictionary) | |
""" | |
for attr, val in kwargs.items(): | |
setattr(model, attr, val) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/MyDrive/nodejs/node_modules/sqlite3/lib/trace.js:28 | |
throw err; | |
^ | |
TypeError: Cannot call method 'split' of undefined | |
at module.exports.QueryGenerator.hashToWhereConditions (/MyDrive/nodejs/node_modules/sequelize/lib/dialects/mysql/query-generator.js:263:29) | |
at _.map.results.length (/MyDrive/nodejs/node_modules/sequelize/node_modules/underscore/underscore.js:102:42) | |
at _.each._.forEach (/MyDrive/nodejs/node_modules/sequelize/node_modules/underscore/underscore.js:89:24) | |
at Function._.map (/MyDrive/nodejs/node_modules/sequelize/node_modules/underscore/underscore.js:101:5) | |
at Object.module.exports.QueryGenerator.hashToWhereConditions (/MyDrive/nodejs/node_modules/sequelize/lib/dialects/mysql/query-generator.js:249:22) | |
at Object.module.exports.QueryGenerator.getWhereConditions (/MyDrive/nodejs/node_modules/sequelize/lib/dialects/mysql/query-generator.js:237:33) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get metric for the object id and today's date | |
var currentDate = new Date(); | |
currentDate.setHours(0); | |
currentDate.setMinutes(0); | |
currentDate.setSeconds(0); | |
console.log(currentDate.toString()); | |
StatMetric.find({ | |
where : { object_id: metricObject.id, stat_type_id: statTypeId, current_date: currentDate} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<key>Customized</key> | |
<dict> | |
<key>Delete Line</key> | |
<string>selectLine:, deleteBackward:</string> | |
<key>Duplicate Lines</key> | |
<string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string> | |
<key>Duplicate Current Line</key> | |
<string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string> | |
</dict> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[UIView beginAnimations:nil context:nil]; | |
[UIView setAnimationDuration:3.7f]; | |
self.scrollView.contentOffset = CGPointMake(77, 77); | |
[UIView commitAnimations]; |
OlderNewer