Permalink
Browse files

Initial population of repository

  • Loading branch information...
1 parent f3bb085 commit 04e726a2a5ac9971d22b83c9fed81a8fe2df0b43 @aclement aclement committed Oct 4, 2012
Showing 2,280 changed files with 308,471 additions and 0 deletions.
View
@@ -0,0 +1,4 @@
+/npm-debug.log
+*~
+.DS_Store
+scripted.log
View
@@ -0,0 +1,94 @@
+/*
+
+ FORMATTER OPTIONS:
+
+ indent_size (default 4) ? indentation size,
+ indent_char (default space) ? character to indent with,
+ preserve_newlines (default true) ? whether existing line breaks should be preserved,
+ preserve_max_newlines (default unlimited) ? maximum number of line breaks to be preserved in one chunk,
+
+ jslint_happy (default false) ? if true, then jslint-stricter mode is enforced.
+
+ jslint_happy !jslint_happy
+ ---------------------------------
+ function () function()
+
+ brace_style (default "collapse") ? "collapse" | "expand" | "end-expand" | "expand-strict"
+ put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line.
+
+ expand-strict: put brace on own line even in such cases:
+
+ var a =
+ {
+ a: 5,
+ b: 6
+ }
+ This mode may break your scripts - e.g "return { a: 1 }" will be broken into two lines, so beware.
+
+ space_before_conditional (default true) ? should the space before conditional statement be added, "if(true)" vs "if (true)",
+
+ unescape_strings (default false) ? should printable characters in strings encoded in \xNN notation be unescaped, "example" vs "\x65\x78\x61\x6d\x70\x6c\x65"
+
+
+
+ CONFIGURATION OPTION EXAMPLES:
+
+ "formatter": {
+ "js": {
+ "indent_size": 1,
+ "indent_char": "\t"
+ }
+ },
+ "ui": {
+ "font":"Ubuntu Mono",
+ "font_size":18,
+ "content_assist_font_size":14,
+ "navigator": false
+ }
+
+ EXEC configuration examples:
+
+ "exec": {
+ "onKeys" : {
+ "ctrl+alt+b": {
+ "cmd": "ls -la",
+ "cwd": "${dir}",
+ "name": "ls current dir"
+ },
+ "ctrl+alt+shift+b": "ls -la",
+ "ctrl+alt+shift+x": "this command is very long and should be too long for a name",
+ "ctrl+alt+shift+y": "this command is very long and should be too long for a name like this",
+ "ctrl+alt+shift+c": "javac ${file}"
+ },
+ "afterSave" : {
+ "** / *.js": "cat ${file}", //!!!Spaces arround the / should be removed!!!
+ ".rigel": "echo Thank you for saving me!",
+ "** / .rigel": "echo ${file}" //!!!Spaces arround the / should be removed!!!
+ },
+ "onLoad" : [
+ "echo Loading ${projectDir}",
+ { "cmd": "ls -la",
+ "cwd": "${projectDir}/client"
+ }
+ ]
+ }
+
+ "exec": {
+ "onKeys" : {
+ "ctrl+alt+c": "node releng/copycheck.js"
+ }
+ },
+ "formatter": {
+ "js": {
+ "indent_size": 1,
+ "indent_char": "\t"
+ }
+ }
+{
+ "ui": {
+ "font": "Monaco"
+ }
+ }
+*/
+{
+}
View
@@ -0,0 +1,35 @@
+@echo off
+setlocal enableDelayedExpansion
+
+set thisdir=%~dp0
+pushd..
+cd %thisdir%..
+set rootdir=%cd%
+popd
+
+rem taskkill /F /IM "node.exe" > killed.log 2>&1
+
+echo =================================================== >> scripted.log
+echo launching node again: %DATE% %TIME% >> scripted.log
+
+set arg=%1
+set identifiers=%arg:~1,2%
+
+IF %identifiers% EQU :\ (
+set patharg=%1
+) ELSE (
+set patharg=%cd%\%1
+)
+
+set patharg=%patharg:\=/%
+set "patharg=!patharg: =%%20!"
+
+echo Starting scripted.js... >> scripted.log
+
+start node-inspector &
+
+start /MIN cmd /c node --debug-brk %rootdir%\server\scripted.js^>^>scripted.log
+
+start http://127.0.0.1:8080/debug?port=5858
+
+start http://localhost:7261/editor.html?%patharg%
View
@@ -0,0 +1,43 @@
+#!/bin/bash
+# Launch script for scripted, intended to be uses as an 'Open With' application for gnome.
+# It differs from the regular scripted script in that we assume gnome will always pass
+# an absolute file reference to the file that is to be opened.
+
+# Does the following:
+# 1. locate any existing running node (big assumption that 'node app.js' is the node app we want)
+# 2. Kills it
+# 3. Calls 'launchnode' to start a new node
+# 4. Opens a URL that loads the editor - the url encodes the file we want to edit
+
+pid=`ps axu | grep "node app.js" | grep -v grep | awk '{print $2}'`
+#echo $pid
+
+DIRNAME=`dirname "$0"`
+CHROME=/opt/google/chrome/chrome
+
+if [ ! -z "$pid" ]
+then
+# echo "killing node"
+ kill -9 $pid
+fi
+echo "===" >> $DIRNAME/../scripted.log
+echo "launching node again: `date`" >> $DIRNAME/../scripted.log
+$DIRNAME/launchnode >> $DIRNAME/../scripted.log 2>&1 &
+
+file="$1"
+URL=http://localhost:7261/editor.html?$file
+
+sleep 0.10
+echo "opening $file"
+if [ -f $CHROME ]; then
+ $CHROME $URL
+elif which gnome-open > /dev/null; then
+ gnome-open $URL
+elif which xdg-open > /dev/null; then
+ xdg-open $URL
+elif which open > /dev/null; then
+ open $URL
+else
+ echo "Could not detect the web browser to use."
+fi
+
View
@@ -0,0 +1,10 @@
+pid=`ps axu | grep "node scripted.js" | grep -v grep | awk '{print $2}'`
+echo $pid
+
+DIRNAME=`dirname "$0"`
+
+if [ ! -z "$pid" ]
+then
+ echo "Killing $pid"
+ kill -9 $pid
+fi
View
@@ -0,0 +1,4 @@
+# Node launch script
+DIRNAME=`dirname "$0"`
+cd $DIRNAME/../server
+node scripted.js
View
@@ -0,0 +1,8 @@
+#!/bin/bash
+killserver
+
+DIRNAME=`dirname "$0"`
+echo "===" >> $DIRNAME/../scripted.log
+echo "launching node again: `date`" >> $DIRNAME/../scripted.log
+$DIRNAME/launchnode >> $DIRNAME/../scripted.log 2>&1 &
+exit 0
View
91 bin/scr
@@ -0,0 +1,91 @@
+#!/bin/bash
+# Launch script for Scripted
+
+# Does the following:
+# 1. locate any existing running node (big assumption that 'node scripted.js' is the node app we want)
+# 2. Kills it
+# 3. Calls 'launchnode' to start a new node
+# 4. Opens a URL that loads the editor - the url encodes the file we want to edit
+
+pid=`ps axu | grep "node scripted.js" | grep -v grep | awk '{print $2}'`
+# echo "pid = " $pid
+
+DIRNAME=`dirname "$0"`
+
+if [ ! -z "$pid" ]
+then
+# echo "killing node"
+ kill -9 $pid
+fi
+echo "===" >> $DIRNAME/../scripted.log
+echo "launching node again: `date`" >> $DIRNAME/../scripted.log
+# echo $DIRNAME/launchnode
+
+$DIRNAME/launchnode >> $DIRNAME/../scripted.log 2>&1 &
+
+# DONT DO THIS, IF EDITING A FILE TO CREATE IT, YOU MAY DISAPPEAR INTO A COSTLY SEARCH
+# If the file does not exist, try to find it with a quick search.
+#fileexists=`ls $1 2>/dev/null`
+#if [ -z "$fileexists" ]
+#then
+#candidate=`find . -name "$1" | head -1 | sed 's/^..//'`
+#if [ -z "$candidate" ]
+#then
+# echo "Cannot find $1"
+# exit 1
+#else
+# file=$candidate
+#fi
+#else
+#file="$1"
+#fi
+file="$1"
+
+dir=`pwd`
+
+# if nothing specified, just exit (server will have restarted)
+if [ -z "$file" ]
+then
+ echo "Not opening an editor, no file specified. Server has been restarted."
+ exit 0
+fi
+
+if [ "$file" == "." ]
+then
+ URL=http://localhost:7261/editor.html?$dir
+else
+ # does it start with a slash or is it relative?
+ if [ `echo "$file " | cut -c1` == '/' ]
+ then
+ URL=http://localhost:7261/editor.html?$file
+ else
+ URL=http://localhost:7261/editor.html?$dir/$file
+ fi
+fi
+
+
+sleep 0.20
+
+# some code to add an extra wait if the server hasn't started yet, work in progress
+#serverUp=`curl http://localhost:7261/helo 2>&1`
+#curlErrored=`echo $serverUp | grep "(7)"`
+#echo "errored: $curlErrored"
+#if [ ! -z "$curlErrored" ]
+#then
+# sleep 0.20
+# serverUp=`curl http://localhost:7261/helo 2>&1`
+# curlErrored=`echo $serverUp | grep "(7)"`
+# echo "errored2: $curlErrored"
+#fi
+
+
+# echo "opening $dir/$file"
+if which gnome-open > /dev/null; then
+ gnome-open "$URL"
+elif which xdg-open > /dev/null; then
+ xdg-open "$URL"
+elif which open > /dev/null; then
+ open "$URL"
+else
+ echo "Could not detect the web browser to use."
+fi
View
@@ -0,0 +1,38 @@
+@echo off
+setlocal enableDelayedExpansion
+
+set thisdir=%~dp0
+pushd..
+cd %thisdir%..
+set rootdir=%cd%
+popd
+
+rem taskkill /F /IM "node.exe" > killed.log 2>&1
+
+echo =================================================== >> scripted.log
+echo launching node again: %DATE% %TIME% >> scripted.log
+
+set arg=%1
+IF "%arg%" EQU "." (
+set patharg=%cd%\
+) ELSE (
+ set identifiers=%arg:~1,2%
+ IF DEFINED identifiers (
+ IF "%identifiers%" EQU ":\" (
+ set patharg=%1
+ ) ELSE (
+ set patharg=%cd%\%1
+ )
+ ) ELSE (
+ set patharg=%cd%\
+ )
+)
+
+set patharg=%patharg:\=/%
+set "patharg=!patharg: =%%20!"
+
+echo Starting scripted.js... >> scripted.log
+
+start /MIN cmd /c node %rootdir%\server\scripted.js^>^>scripted.log
+
+start "" "http://localhost:7261/editor.html?%patharg%"
Oops, something went wrong.

0 comments on commit 04e726a

Please sign in to comment.