A list of slides from nodeconf
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net472</TargetFramework> | |
</PropertyGroup> | |
<PropertyGroup> | |
<GeneratedText><![CDATA[ | |
using System%3B |
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
string GetTargetSqlServerVersion(){ | |
var dte = (DTE)GetService(typeof(DTE)); | |
var project = dte.ActiveDocument.ProjectItem.ContainingProject; | |
return project.GetType().GetProperty("Globals").GetValue(project).GetType().GetProperty("Parent").GetValue(project.GetType().GetProperty("Globals").GetValue(project)).GetType().GetProperty("DatabaseSchemaProvider").GetValue(project.GetType().GetProperty("Globals").GetValue(project).GetType().GetProperty("Parent").GetValue(project.GetType().GetProperty("Globals").GetValue(project))).GetType().GetProperty("Platform").GetValue(project.GetType().GetProperty("Globals").GetValue(project).GetType().GetProperty("Parent").GetValue(project.GetType().GetProperty("Globals").GetValue(project)).GetType().GetProperty("DatabaseSchemaProvider").GetValue(project.GetType().GetProperty("Globals").GetValue(project).GetType().GetProperty("Parent").GetValue(project.GetType().GetProperty("Globals").GetValue(project)))) | |
} |
Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.
Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.
On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation
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
Steps: | |
0. Checkout your git repo from the server (I use /var/www/carbonite) | |
1. Upload both of these files to the same directory on your server | |
2. chmod +x restart_node.sh | |
3. nohup node github_post_commit.js 2>&1 >> github_post_commit.log & | |
4. In the github admin for your repo, set a post commit hook to the url http://<your host>:8080/ | |
5. Make a commit to your repo | |
6. Point a browser at http://<your host>:8080/ and you should see the commit |
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
coffee = require 'coffee-script' | |
https = require 'https' | |
npm = require 'npm' | |
Irc = require 'irc-js' | |
cradle = require 'cradle' | |
{GitHubApi} = require 'github' | |
request = require 'request' | |
gitHubApi = new GitHubApi() | |
githubIssueApi = gitHubApi.getIssueApi() | |
githubObjectApi = gitHubApi.getObjectApi() |
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 follow = require("follow") | |
var seen = {} | |
follow({ db: "http://isaacs.ic.ht/registry" | |
, since: 20267 | |
, include_docs: true }, function (er, update) { | |
if (er) throw er | |
var doc = update.doc |
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
startup.customRuntimeMain = function () { | |
var path = NativeModule.require('path'); | |
var custom = path.resolve(process.cwd(), process.argv[0] + ".js"); | |
if (!path.existsSync(custom)) return; | |
process.argv[1] = custom; | |
}; |
NewerOlder