Skip to content

Instantly share code, notes, and snippets.

#pragma unused(parameterName)
@linusthe3rd
linusthe3rd / gist:9039696
Last active August 29, 2015 13:56
UIKit Corner Radius
#import "YourViewController.h"
#import <QuartzCore/QuartzCore.h> // required to modify the corner radius
//.....Setup your controller...
- (void)viewDidLoad {
[super viewDidLoad];
self.myView.layer.cornerRadius = 8; //add a corner radius to the UILabel
}
var myModel = {
"foo": 1
}
var newData = {
"foo": "newValue",
"bar": "baz"
}
merge(myModel, newData);
// myModel's new value:
// {
// "foo": "newValue", // the "foo" attribute has a new value
// "bar": "baz"
// }
fill(myModel, newData);
// myModel's new value:
// {
// "foo": 1, // the "foo" attribute was not modified
// "bar": "baz"
// }
input[type="submit"],
input[type="reset"],
input[type="button"],
button,
textarea {
font-family: inherit;
-webkit-font-smoothing: inherit;
}
@linusthe3rd
linusthe3rd / gist:432c8354d293d1ad4713
Created July 20, 2015 19:29
Check if Import/Dependency is Available at Runtime
from __future__ import print_function
// ...other dependencies...
try:
import requests
except ImportError:
print('You must install the "requests" package in order to use '
'the sync writer: `pip install requests`')
@linusthe3rd
linusthe3rd / gist:673665
Created November 12, 2010 02:58
YourViewController.m
#import "YourViewController.h"
#import <QuartzCore/QuartzCore.h> //required to achieve corner radius
//.....Setup your controller...
- (void)viewDidLoad {
[super viewDidLoad];
//add a corner radius to the UILabel
self.label.layer.cornerRadius = 8;
}
//....the rest of your controller code goes here...
alert( "hello world" );
var inputArray = [];
$('#listOfData').each( function(){
inputArray.push( this.value );
});
$.post( 'yourServerPage.php', {
'data[]': inputArray
}, function( outputData ){
$('#outputDiv').empty().append( outputData );
});