Skip to content

Instantly share code, notes, and snippets.

@AlecTaylor
AlecTaylor / ServiceInterface\AddressService.cs
Created May 21, 2012 17:36
Address complete OrmLite + ServiceStack example
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Data.SqlClient;
using ServiceStack.DataAnnotations;
using ServiceStack.OrmLite;
using ServiceStack.ServiceHost;
using ServiceStack.ServiceInterface;
using ServiceStack.ServiceInterface.ServiceModel;
@AlecTaylor
AlecTaylor / web2py_example.py
Created September 28, 2012 05:33
REST code-golf
# models\choices.py
db.define_table(
'choice_list',
Field('choice', notnull=True, default='Yes', requires=IS_IN_SET(['Yes', 'Maybe', 'No']))
)
# controllers\default.py
@service.json
def get_choices():
return db(db.choice_list).select(db.choice_list.choice)
@AlecTaylor
AlecTaylor / Error.md
Last active January 1, 2016 02:19 — forked from anonymous/Error.md

###Error received when running karma start configs/karma.cf.js

INFO [PhantomJS 1.9.2 (Linux)]: Connected on socket PK-IbFeI1qpFq0fix6WI
PhantomJS 1.9.2 (Linux) IndexController should add name parameter to scope FAILED
Error: [$injector:modulerr] http://errors.angularjs.org/1.2.6/$injector/modulerr?p0=myapp.controllers&p1=Error%3A%20%5B%24injector%3Anomod%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.2.6%2F%24injector%2Fnomod%3Fp0%3Dmyapp.controllers%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9877%2Fbase%2Fpublic%2Fapp%2Flib%2Fangular%2Fangular.min.js%3F1387689655000%3A20%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9877%2Fbase%2Fpublic%2Fapp%2Flib%2Fangular%2Fangular.min.js%3F1387689655000%3A21%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A9877%2Fbase%2Fpublic%2Fapp%2Flib%2Fangular%2Fangular.min.js%3F1387689655000%3A29
    at /home/Projects/abbrevi8-karma-tests/public/app/lib/angular/angular.min.js:29
TypeError: 'undefined' is not an object (evaluating 'scope.name')

at /home/Projects/abbrevi8-ka

@AlecTaylor
AlecTaylor / CMakeLists.txt
Last active August 29, 2015 13:55
Troubleshooting adding CMake to node.native
project(node_native)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
include_directories(../node_native ../node_native/libuv/include ../node_native/http-parser)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/../node_native/libuv/libuv.a
COMMAND make
rhc app create ip diy
rhc ssh ip
scl enable python27 bash
cd $OPENSHIFT_DATA_DIR
virtualenv ipython
cd ipython
#!/usr/bin/env bash
RUBY_VERSION=2.1.0
printf "Installing Ruby $RUBY_VERSION\\n"
if [ -d ruby_build ]; then
rm -Rf ruby_build
fi
if [[ ! (`command -v ruby` && `ruby --version | colrm 13` == "ruby" "$RUBY_VERSION""p0") ]] ; then
rhc app create ipython python-2.7
rhc env set LC_ALL='en_US.UTF-8' --app ipython
rhc env set LANG='en_US.UTF-8' --app ipython
rhc ssh ipython
pip install ipython pyzmq tornado
killall httpd
@AlecTaylor
AlecTaylor / node version et al
Created June 9, 2014 02:35
Issue attachments
> yo --version && echo %PATH% %NODE_PATH% && node -e "console.log(process.platform, process.versions)"
1.1.2
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\cURL\bin;C:\usr\Python27\Scripts;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\PuTTY;E:\usr\MiKTeX 2.9\miktex\bin\x64\;E:\usr\SlikSvn\bin;E:\usr\LLVM\bin;E:\Program Files (x86)\Heroku\bin;C:\Program Files (x86)\git\cmd;E:\usr\Ruby200-x64\bin;C:\Program Files (x86)\cwRsync\bin;E:\Program Files (x86)\wkhtmltopdf\bin;E:\usr\mingw64\bin;C:\Users\AlecTaylor\AppData\Roaming\npm;E:\usr\nodejs;E:\usr\SlikSvn\bin;E:\usr\bin;E:\Program Files\MongoDB 2.6
@AlecTaylor
AlecTaylor / npm-debug.log
Created June 16, 2014 11:36
npm failing on bower (`sudo npm install -g bower`)
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'bower' ]
2 info using [email protected]
3 info using [email protected]
4 verbose cache add [ 'bower', null ]
5 verbose cache add name=undefined spec="bower" args=["bower",null]
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/bin/npm', 'install' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink /usr/bin/node
5 warn package.json [email protected] No description
6 warn package.json [email protected] No repository field.
7 warn package.json [email protected] No README data
8 verbose readDependencies using package.json deps
9 verbose install where, deps [ '/tmp/b',