Skip to content

Instantly share code, notes, and snippets.

View ianp's full-sized avatar

Ian Phillips ianp

View GitHub Profile
@ianp
ianp / index.html
Last active February 11, 2020 11:25
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>My App</title>
<script src="https://apis.google.com/js/client:platform.js?onload=startup" async defer></script>
</head>
<body>
<p id="app"></p>
@ianp
ianp / package.json
Created October 3, 2016 13:13
The simplest Jest example.
{
"name": "foo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "jest"
},
"author": "",
"license": "ISC",
@ianp
ianp / nbproject.sh
Created October 3, 2012 17:27
Setting up a NetBeans RCP project from the shell.
$ cd ~/Projects
$ mvn -DarchetypeGroupId=org.codehaus.mojo.archetypes \
-DarchetypeArtifactId=netbeans-platform-app-archetype \
-DarchetypeVersion=1.12 \
archetype:generate
...
Define value for property 'groupId': com.example
Define value for property 'artifactId': app
Define value for property 'version': 1.0-SNAPSHOT
Define value for property 'package': com.example.app
@ianp
ianp / add-externals.sh
Created September 24, 2012 16:18
Sharing Code in BusinessWorks
$ cd /home/tibco/projects/FooProject
$ ls
.svn AESchemas defaultVars .folder vcrepo.dat
$ svn propset svn:externals 'LibCommon http://svnhost/projects/LibCommon/tags/1.0/LibCommon' .
property 'svn:externals' set on '.'
$ svn commit -m "Added dependency on LibCommon version 1.0"
...
$ svn up
Fetching external item into 'LibCommon'
A LibCommon/...
@ianp
ianp / wordcounters.m
Created April 16, 2012 20:20
Word count functions and main wrapper.
#import <Foundation/Foundation.h>
NSUInteger scannerWordCount(NSString* string)
{
NSScanner* scanner = [NSScanner scannerWithString:string];
NSCharacterSet* ws = [NSCharacterSet whitespaceAndNewlineCharacterSet];
NSUInteger words = 0;
while ([scanner scanUpToCharactersFromSet:ws intoString:nil])
++words;
return words;