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 validate_jira_id(jira_id, jira_username, jira_password): | |
""" Throw an exception if the jira_id is invalid. """ | |
request_url = JIRA_BASE_URL + '/rest/api/2/issue/' + jira_id | |
response = requests.get(request_url, auth=(jira_username, jira_password)) | |
if response.status_code == 404: | |
raise ValueError('Jira ticket not found.') | |
if response.status_code != 200: | |
raise ValueError('Unexpected status code during lookup: {}'.format(response.status_code)) |
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
var URL_BASE="http://www.baby-connect.com"; | |
var URL_AUTH="/Cmd?cmd=UserAuth"; | |
var URL_MAIN="/home"; | |
function logWithPrefix(prefix, msg) { | |
console.log('(' + prefix + ') ' + msg); | |
} | |
function requestHandler(response, num) { | |
try { |
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
# Convert SVG to EPS | |
function svgToEps() | |
{ | |
if test $# -lt 1 ; then | |
echo "You need to pass in a filename." ; return | |
fi | |
epsfile=${1%.*}.eps | |
echo "inkscape -f $1 -E $epsfile" |
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
module square_funnel(steps, thickness, height, | |
s_dim, s_oRadius, s_iRadius, | |
e_dim, e_oRadius, e_iRadius) | |
{ | |
// Calculate interpolation steps. | |
extrude_length = height / steps; | |
w_s = (e_dim[0] - s_dim[0]) / steps; | |
l_s = (e_dim[1] - s_dim[1]) / steps; | |
ir_s = (e_iRadius - s_iRadius) / steps; | |
or_s = (e_oRadius - s_oRadius) / steps; |
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
// Tube with measurements to fit around something. | |
module fit_outside_tube(dim, thickness, radius) { | |
w = dim[0]; | |
l = dim[1]; | |
h = dim[2]; | |
or = min(w, l) * 0.1; | |
ir = radius; | |
// Extrude the tube |
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 streamFileCommands() { | |
boolean skip; | |
// Keep sending commands until the last command is sent, or the | |
// character buffer is full. | |
while ((this.commandBuffer.currentCommand().isSent() == false) && | |
CommUtils.checkRoomInBuffer(this.activeCommandList, this.commandBuffer.currentCommand())) { | |
skip = false; | |
GcodeCommand command = this.commandBuffer.currentCommand(); |
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
#define kBatchSize 20 | |
// This could take a while. | |
+ (void) recalculateAllStats { | |
MyAppDelegate *myAppDelegate = (MyAppDelegate *) | |
[[UIApplication sharedApplication] delegate]; | |
NSManagedObjectContext *moc = | |
[myAppDelegate managedObjectContext]; | |
NSEntityDescription *entity = | |
[NSEntityDescription entityForName:@"Entry" |
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
- (id) init { | |
if (self = [super initWithFrame:CGRectMake(0, 0, 94, 27)]) { | |
[self initCommon]; | |
} | |
return 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
... | |
// To use, place this code somewhere in your View Controller, | |
// all you need it to do is give it a size and an array of | |
// data. | |
NSMutableArray* data = | |
[[NSMutableArray alloc] initWithObjects: | |
@"Andy",@"Erik",@"Aaron",@"Frank",@"Will",@"Joe",nil]; |
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)startSplash { | |
[[[[UIApplication sharedApplication] windows] objectAtIndex:0] addSubview:self]; | |
splashImage = [[UIImageView alloc] initWithImage:self.image]; | |
if (self.animationIn == SplashViewAnimationNone) | |
{ | |
[self addSubview:splashImage]; | |
} | |
else if (self.animationIn == SplashViewAnimationFade) | |
{ |