public interface IService
{
Customer GetCustomerById(int id);
Customer[] GetCustomerByIds(int[] id);
Customer GetCustomerByUserName(string userName);
Customer[] GetCustomerByUserNames(string[] userNames);
Customer GetCustomerByEmail(string email);
# Given a function that accepts a function followed by a non-function argument... | |
foo = (callback, name) -> | |
console.log "Calling callback #{name}..." | |
callback() | |
# you end up with a line starting with | |
# a comma which just feels wrong... | |
foo -> | |
console.log "Callback called!" | |
, "bar" |
# Namespace tool for accessing our namespace | |
# | |
# Usage: | |
# bar = NS "PWB.foo.bar" | |
# | |
# Idea from Javascript Patterns by Stoyan Stefanov | |
# | |
window.NS = (nsString) -> | |
parent = window | |
for ns in nsString.split "." |
log = (o) -> console.log o | |
# -------------- CLASS DEFINITIONS ------------- | |
# Private methods are starting with underscore, but this is just for better readability | |
class SimpleOOPPattern | |
@classProperty: 'le class property' | |
@classMethod: -> | |
'le class method' | |
publicProperty: 'le public property' |
# Apart from the basic niceties of being able to leave off | |
# parens in clear calls... | |
print 10 | |
alert "Hello #{name}" | |
# ... the reason why they're important to have in CoffeeScript | |
# is because it allows our "block" syntax (single function body |
You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.
- postgresql
- postgresql-client
- libpq-dev
Every time I start a new project, I want to pull in a log
function that allows the same functionality as the console.log
, including the full functionality of the Console API.
There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log
was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.
This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:
- The full version: Inspired by the plugin in HTML5 Boilerplate. Use this if you are writing an application and want to create a window.log function. Additionally,
public static class ObjectExtensions | |
{ | |
/// <summary> | |
/// The string representation of null. | |
/// </summary> | |
private static readonly string Null = "null"; | |
/// <summary> | |
/// The string representation of exception. | |
/// </summary> |
var gulp = require('gulp'); | |
var browserify = require('gulp-browserify'); | |
var concat = require('gulp-concat'); | |
var styl = require('gulp-styl'); | |
var refresh = require('gulp-livereload'); | |
var lr = require('tiny-lr'); | |
var server = lr(); | |
var paths = { | |
js: 'src/**/*.js', |
# This script only works when Google Drive is mounted at G:\ | |
# Change the encoding to UTF-8-BOM before executing this script | |
# To run this file: powershell -noprofile -executionpolicy bypass -file ./PinGoogleDriveFS.ps1 [add/remove] | |
# Settings | |
$ErrorActionPreference = "Stop" | |
$clsid = "{81539FE6-33C7-4CE7-90C7-1C7B8F2F2D41}" # CLSID for personal drive namespace | |
$clsid_i = "{0E5AAE11-A475-4c5b-AB00-C66DE400274E}" # CLSID for personal drive instance | |
$clsid_g = "{FB9411E2-c3F8-4004-BA95-47D459C219D1}" # CLSID for shared drive namespace | |
$clsid_g_i = "{1A223FF4-D08D-4B38-A051-5D2391FE655C}" # CLSID for shared drive instance |