This file contains 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
<form method="post"> | |
<dl> | |
{% for field in form %} | |
<dt>{{field.label_tag}}</dt> | |
<dd>{{field}}</dd> | |
{% if field.errors %}<dd class="field-errors">{{field.errors.as_text}}</dd>{% endif %} | |
{% endfor %} | |
<dt> </dt> | |
<dd><button type="submit">Submit</button></dd> | |
</dl> |
This file contains 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
#include <dirent.h> | |
#include <string> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <iostream> | |
#include <fstream> |
This file contains 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
(function(){ | |
var conf = new Configure(); | |
conf.verbose(true); | |
conf.compiler('gcc'); | |
conf.includes(['src/headers', 'deps/v8/include']); | |
conf.libs(['deps/v8/libv8.a']); | |
conf.flags(['lpthread', 'g']); | |
conf.src(['src/bob.cc', 'src/configure.cc', 'src/environment.cc', 'src/filesys.cc', 'system.cc', 'utils.cc']); | |
conf.target('build/bob'); |
This file contains 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
C++: | |
void Blah(int &someint) | |
{ | |
someint++; | |
} | |
void playWithBlah() | |
{ | |
int x = 0; | |
Blah(x); |
This file contains 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
<script type="text/javascript" charset="utf-8"> | |
;(function($){ | |
var views = {}; | |
views.FULL_WIDTH = "100%"; | |
views.__builder = Class.extend({ | |
init: function(options) | |
{ | |
this.styles = options.styles || false; | |
this.classes = options.classes || false; |
This file contains 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
(function() { | |
var http = require('http'), | |
fs = require('fs'), | |
url = require('url'), | |
conf = require('./conf').FosterConfig; | |
var server = http.createServer(); | |
server.addListener('request', function(data, response){ | |
if(data.url !== '/favicon.ico') |
This file contains 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
- (void) awakeFromNib | |
{ | |
[super awakeFromNib]; | |
CDTest_AppDelegate *appDelegate = (CDTest_AppDelegate *)[[NSApplication sharedApplication] delegate]; | |
NSManagedObjectContext *context = [appDelegate managedObjectContext]; | |
Account *account = (Account *)[NSEntityDescription insertNewObjectForEntityForName:@"Account" inManagedObjectContext:context]; | |
account.username = @"wess"; |
This file contains 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
<?php | |
class AppView | |
{ | |
private $settings; | |
private $templateDirectory; | |
private $template; | |
private $ext; | |
private $layout; | |
private $pageVars = array(); | |
private $post = array(); |
This file contains 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 decorator_here(func): | |
def wrapper(func): | |
x = func() | |
return "%s , goodbye world" | |
return wrapper | |
@decorator_here | |
def testing(): | |
return "hello world" |
This file contains 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
class User(BaseModel): | |
username = models.CharField(max_length=20) | |
password = models.CharField(max_length=20) | |
groups = models.ManyToManyField('Group', related_name='groups', db_table='USERS_TO_GROUPS') | |
class Group(BaseModel): | |
name = models.CharField(max_length=20) | |
users = ManyToManyField(User, related_name='users', db_table=u'USERS_TO_GROUPS') |
OlderNewer