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
# company/models.py | |
from django.conf import settings | |
from django.db import models | |
from diagnose.models import IdentityModel | |
from users.models import User | |
class Company(IdentityModel): | |
name = models.CharField(max_length=200) | |
website = models.URLField() | |
logo = models.FileField() |
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
#!/usr/bin/env ruby | |
require 'thor' | |
require 'open-uri' | |
require 'fileutils' | |
require 'etc' | |
require 'zip' | |
require 'erb' | |
URL = "https://github.com/wess/center-stage/archive/master.zip" |
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
- (UIColor *)colorByChangingAlphaTo:(CGFloat)alpha | |
{ | |
CGFloat *oldComponents = (CGFloat *)CGColorGetComponents([self CGColor]); | |
size_t numComponents = CGColorGetNumberOfComponents([self CGColor]); | |
CGFloat newComponents[4]; | |
switch (numComponents) | |
{ | |
case 2: |
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
extension CGImage { | |
func blurEffect(boxSize: Float) -> CGImageRef! { | |
let boxSize = boxSize - (boxSize % 2) + 1 | |
let inProvider = CGImageGetDataProvider(self) | |
let height = vImagePixelCount(CGImageGetHeight(self)) | |
let width = vImagePixelCount(CGImageGetWidth(self)) | |
let rowBytes = CGImageGetBytesPerRow(self) |
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
// | |
// Alter.swift | |
// Alter | |
// | |
// Created by Wesley Cope on 7/16/15. | |
// Copyright © 2015 Wess Cope. All rights reserved. | |
// | |
/* USAGE: |
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
// | |
// Byway.swift | |
// Byway | |
// | |
// Created by Wesley Cope on 7/16/15. | |
// Copyright © 2015 Wess Cope. All rights reserved. | |
// | |
/* USAGE: |
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
- (float) productOfA: (const float) a b: (const char) b { | |
if (b > 0) | |
return a; | |
if (b < 0) | |
return -a; | |
return 0; | |
} |
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'); |