This file contains hidden or 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
function injectViewportMetaTag() { | |
var meta = $(document.createElement('meta')); | |
meta.name = 'viewport'; | |
meta.content = 'width=device-width, initial-scale=1'; | |
$$('head')[0].insert(meta); | |
}; |
This file contains hidden or 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
function injectSignature() { | |
var footer = $(document.getElementById('footer')); | |
footer.appendChild(document.createTextNode | |
("Responsive Theme by Xander Dumaine 2011")); | |
} |
This file contains hidden or 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
function injectAppleTouchIcons() { | |
var link = $(document.createElement('link')); | |
link.setAttribute('rel', 'apple-touch-icon'); | |
link.setAttribute('href', '/themes/mobile/images/touch/apple-touch-icon.png'); | |
$$('head')[0].insert(link); | |
link = $(document.createElement('link')); | |
link.setAttribute('rel', 'apple-touch-icon'); | |
link.setAttribute('href', '/themes/mobile/images/touch/apple-touch-icon-72x72-precomposed.png'); | |
link.setAttribute('sizes', '72x72'); |
This file contains hidden or 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
@media only screen and (min-device-width: 480px) { ... } | |
@media only screen and (min-device-width: 600px) { ... } | |
@media only screen and (min-width: 770px) { ... } |
This file contains hidden or 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
<Window.TaskbarItemInfo> | |
<TaskbarItemInfo Description="My Taskbar Sample" ProgressState="Normal"> | |
<TaskbarItemInfo.ProgressValue> | |
<MultiBinding Converter="{StaticResource ProgressBarConverter}"> | |
<Binding Path="SongsUsed" Mode="OneWay" Converter="{StaticResource ListToCountConverter}"/> | |
<Binding Path="NumberOfSongs"/> | |
</MultiBinding> | |
</TaskbarItemInfo.ProgressValue> | |
<TaskbarItemInfo.ThumbButtonInfos> | |
<ThumbButtonInfoCollection> |
This file contains hidden or 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
// called from code behind | |
Utilities.ResolveWebPartList("MyListName", MyListWebPart); | |
// In a utilities class | |
internal static void ResolveWebPartList(string listName, XsltListViewWebPart listViewWebPart) | |
{ | |
using (var site = new SPSite(SPContext.Current.Web.Url)) | |
using (var web = site.OpenWeb()) | |
{ |
This file contains hidden or 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
for(var year = 2000; year < 2050; year++) { | |
for(var month = 1; month < 13; month++) { | |
for(var day = 1; day < 32; day++) { | |
server.get('/' + year + '/' + (month < 10 ? '0' : '') + month + '/' + (day < 10 ? '0' : '') + day + '/:slug/', frontend.single); | |
} | |
server.get('/' + year + '/' + (month < 10 ? '0' : '') + month + '/:slug/', frontend.single); | |
} | |
server.get('/' + year + '/:slug/', frontend.single); | |
} |
This file contains hidden or 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
// in code behind (null checking/exception catching omitted for clarity) | |
var listItemId = int.Parse(Request["ID"]); | |
Utilities.ResolveListFormWebPart("MyListName", listItemId, MyListFormWebPart); | |
// in utilities class | |
internal static void ResolveListFormWebPart(string listName, int listItemId, ListFormWebPart listFormWebPart) | |
{ | |
using (var site = new SPSite(SPContext.Current.Web.Url)) | |
using (var web = site.OpenWeb()) | |
{ |
This file contains hidden or 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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains hidden or 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
private static OpenIdRelyingParty openId = new OpenIdRelyingParty(); | |
[HttpPost] | |
public ActionResult OpenId(string identifier) | |
{ | |
if (!Identifier.IsValid(identifier)) | |
{ | |
ModelState.AddModelError("loginIdentifier", | |
"The specified login identifier is invalid"); | |
return RedirectToAction("Index"); |
OlderNewer