A Pen by Aran Mulholland on CodePen.
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
/* print a CFNumber */ | |
void printCfNumber(CFNumberRef cfNum) { | |
SInt32 s; | |
if(!CFNumberGetValue(cfNum, kCFNumberSInt32Type, &s)) { | |
printf("***CFNumber overflow***"); | |
return; | |
} | |
printf("%d", (int)s); | |
} |
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
require.config({ | |
paths: { | |
//3rd Party libraries | |
'knockout': 'knockout-2.2.0.debug', | |
'jquery': 'jquery-1.7.1', | |
'doubletap': 'jquery.doubletap', | |
'address': 'jquery.address-1.4.min', | |
'bootstrap': 'bootstrap-2.0.1', | |
'amplify': 'amplify', | |
'JQueryDictionary": "Utilities/JQueryDictionary', |
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 string RenderPartialViewToString(Controller controller, string pathToView, object viewModel, | |
ViewDataDictionary viewData = null) { | |
String result; | |
var viewEngine = ViewEngines.Engines.FindPartialView(controller.ControllerContext, pathToView); | |
using (var writer = new StringWriter()) { | |
var vd = viewData == null ? new ViewDataDictionary(viewModel) | |
: new ViewDataDictionary(viewData) { Model = viewModel }; | |
var viewContext = new ViewContext(controller.ControllerContext, | |
viewEngine.View, |
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
- (void)respondToNotification:(NSNotification *)notification { | |
if (![NSThread isMainThread]) { | |
[self performSelectorOnMainThread:@selector(respondToNotification:) withObject:notification waitUntilDone:YES]; | |
return; | |
} | |
//Code here | |
} |
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
var events = require('events'); | |
function callSomething(){ | |
var eventEmitter = new events.EventEmitter(); | |
console.log("Method called"); | |
eventEmitter.emit("data", "Hello immediately (you will never see this message)"); |
You create a GraphGist by creating a GitHub Gist in AsciiDoc and enter the URL to it in the form on this page. Alternatively, you can put an AsciiDoc document in Dropbox and enter the public URL in the form.
This GraphGist shows the basics of using AsciiDoc syntax and a few additions for GraphGists. The additions are entered as comments on their own line. They are: //console for a query console; //hide, //setup and //output to configure a query; //graph and //table to visualize queries and show a result table.
Click on the Page Source button in the menu to see the source for this GraphGist.
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
#Add the Ubuntu 12.04(precise) repositories | |
cat <<EOF >> /etc/apt/sources.list | |
deb http://archive.ubuntu.com/ubuntu precise main restricted universe | |
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe | |
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse | |
EOF | |
# Update the repos | |
apt-get update |
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
public class MyFunctions | |
{ | |
private readonly IOptions<ApplicationSettings> _applicationSettingsOptions; | |
private readonly IOptions<ConnectionStrings> _connectionStringsOptions; | |
public MyFunctions(IOptions<ApplicationSettings> applicationSettingsOptions, IOptions<ConnectionStrings> connectionStringsOptions) | |
{ | |
// the "Values" section of the configuration file | |
_applicationSettingsOptions = applicationSettingsOptions; | |
OlderNewer