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
- (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 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
#!/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 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
# 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 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
- (void)saveModel:(MTLModel *)model forKey:(NSString *)key error:(NSError *__autoreleasing *)error | |
{ | |
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
NSString *path = [self pathForModel:model]; | |
path = [path stringByAppendingPathComponent:key]; | |
} | |
- (MTLModel *)objectForKey:(NSString *)key |
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
import sys | |
import os | |
import time | |
import atexit | |
from signal import SIGTERM | |
class Daemon: | |
def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): | |
self.pidfile = pidfile |
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
#!/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 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
;(function(exports){ | |
var Namespace = exports.Namespace || {}; | |
exports.Namespace = Namespace; | |
})(window); |
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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="my-element"> |
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
[self.view animate:^(Animator *animator) { | |
animator.x.from = 10; | |
animator.x.to = 20; | |
animator.gravity = 5; | |
animator.elastic = 2; | |
}]; |
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
@implentation UserForm | |
- (SurveyTextField *)username | |
{ | |
return SurveyDefineTextField(^(SurveyTextField *field) { | |
field.placeholder = @"username"; | |
}); | |
} | |
// OR |