Skip to content

Instantly share code, notes, and snippets.

View netshade's full-sized avatar
🧛

Chris Zelenak netshade

🧛
View GitHub Profile
@netshade
netshade / nodejs_example.js
Created October 20, 2015 14:50 — forked from illbzo1/nodejs_example.js
An example Node.js implementation for DocRaptor, that does not rely on any external dependencies.
var https = require("https"),
fs = require("fs");
var payload = JSON.stringify({
user_credentials: "YOUR_API_KEY_HERE",
doc: {
document_content: "<!DOCTYPE html><html><head><title>Javascript PDF Sample</title></head><body>Hello from Javascript!</body></html>",
name: "test.pdf",
document_type: "pdf",
test: true
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: sudo $0 /dev/sdh1"
exit 1;
fi
dd if=$1 of=/dev/null & pid=$!
while true; do
ps -p$pid --no-heading || break;
echo "-- $(date) ------------------";
-(void)setupView:(GLView*)view
{
const GLfloat zNear = -0.01, zFar = 1000.0, fieldOfView = 45.0;
GLfloat size;
glMatrixMode(GL_PROJECTION);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
size = zNear * tanf(DEGREES_TO_RADIANS(fieldOfView) / 2.0);
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
return 40;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UIView * fv = [[[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 0.0, 0.0)] autorelease];
[fv setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
[fv setContentMode:UIViewContentModeTopLeft];
[UIImageView *footer = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"footer_gradient.png"]] autorelease];