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
FB.ui( | |
{ | |
method: 'friends.add', | |
id: fbid // assuming you set this variable previously... | |
}, | |
function(param){ | |
console.log(param); |
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
#import <UIKit/UIKit.h> | |
@interface UIImage (UISegmentIconAndText) | |
+ (id) imageFromImage:(UIImage*)image string:(NSString*)string color:(UIColor*)color; | |
@end |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Leaflet.js - Mark Radius</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.css" /> | |
<!--[if lte IE 8]><link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.ie.css" /><![endif]--> | |
<link rel="stylesheet" href="styles.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> |
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
// Inspired by StackOverflow | |
// http://stackoverflow.com/questions/6644004/how-to-check-if-nsstring-is-numeric | |
#import <Foundation/Foundation.h> | |
@interface NSString (isNumeric) | |
- (BOOL) isAllDigits; | |
- (BOOL) isNumeric; |
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
<!DOCTYPE html> | |
<html lang="html"> | |
<head> | |
<style> | |
.videoWrapper { | |
position: relative; | |
padding-bottom: 56.25%; /* 16:9 */ | |
padding-top: 25px; | |
height: 0; |
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 comment a single line use | |
<%-# commented line -%> | |
This also works | |
<%# my comment %> | |
To comment a whole block use a if false to surrond your code like this |
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
$.fn.scrollLock = function () { | |
return $(this).on("DOMMouseScroll mousewheel", function (h) { | |
var g = $(this), | |
f = this.scrollTop, | |
d = this.scrollHeight, | |
b = g.height(), | |
i = h.originalEvent.wheelDelta, | |
a = i > 0, | |
c = function () { | |
h.stopPropagation(); |
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
// Transition Everything | |
transition: all 0.5s ease-in-out; | |
// becomes these discrete properties | |
transition-property: all; | |
transition-duration: 0.5s; | |
transition-timing-function: ease-in-out; | |
transition-delay: initial; |
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
--- | |
headings: [1, 2, 3, 4, 5, 6] | |
--- | |
<div data-section="headings"> | |
{{#each headings}} | |
{{#withHash num=this text="Heading"}} | |
<h{{num}}>{{text}} {{num}}</h{{num}}> | |
{{/withHash}} | |
{{/each}} |
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
{{#parseJSON '{"type":"text--primary", "text":"Text, Primary Button"}'}} | |
<button class="btn btn--{{type}}">{{text}}</button> | |
{{/parseJSON}} |
OlderNewer