Skip to content

Instantly share code, notes, and snippets.

@leuchtetgruen
leuchtetgruen / bonjour.m
Created June 28, 2011 06:27
Bonjour Quickie in Objective-C - Service Announcement and discovery in just 6 lines of code.
// This is how you announce a service - saying i offer service _someservice._tcp. on port 4711
NSNetService *nets = [[NSNetService alloc] initWithDomain:@"local." type:@"_someservice._tcp." name:@"" port:4711];
[nets setDelegate:self];
[nets publish];
// And this is how you find a service
NSNetServiceBrowser *browser = [[NSNetServiceBrowser alloc] init];
[browser setDelegate:self];
@leuchtetgruen
leuchtetgruen / jqueryboilerplate
Created March 8, 2012 10:13
HTML Boilerplate with JQuery
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
</head>
<body>
</body>
</html>
input[type=text]:focus {
background-color: lightgray;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
tr:nth-child(2n+1) {
background-color: lightgray;
}
tr:first-child {
background-color: gray;
}
h1:before {
content: url(http://www.asp-gmbh.de/img/arrow_left.png);
}
p:first-letter {
font-size: 200%;
}
@font-face {
font-family: 'Droid Sans';
font-style: normal;
font-weight: normal;
src: local('Droid Sans'), local('DroidSans'), url('http://themes.googleusercontent.com/static/fonts/droidsans/v3/s-BiyweUPV0v-yRb-cjciL3hpw3pgy2gAi-Ip7WPMi0.woff') format('woff');
}
body {
font-family: 'Droid Sans', sans-serif;
a.button {
background: linear-gradient(top, whitesmoke, lightgray);
text-decoration: none;
padding: 7px;
padding-right: 10px;
padding-left: 10px;
margin: 10px;
color: #444;
font-family: Arial;
img {
transition: all 0.5s ease-in-out;
}
img:hover {
transform: scaleY(1.5);
}