var dummySocket = new ReadWriteNetStream();
// Debug
dummySocket.on('data', function(data){
console.log('write received', data);
});
dummySocket.write('hey !');
This file contains 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
(ns people | |
(:use [clojure.string :only (join)] | |
[clojure.pprint :only (pprint simple-dispatch)])) | |
;; we can make maps using the special literal form: | |
{:a 100 | |
:b 200} | |
(class {:a 100 :b 200}) |
This file contains 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 ipp = require('ipp'); //get it from there - https://npmjs.org/package/ipp - $npm install ipp | |
var request = require('request'); //get it from there - https://npmjs.org/package/request - $npm install request | |
var fs = require('fs'); | |
function getPrinterUrls(callback) { | |
var CUPSurl = 'http://localhost:631/printers';//todo - change of you have CUPS running on other host | |
request(CUPSurl, function (error, response, body) { | |
if (!error && response.statusCode == 200) { | |
var printersMatches = body.match(/<TR><TD><A HREF="\/printers\/([a-zA-Z0-9-^"]+)">/gm);//i know, this is terrible, sorry( | |
var printersUrls = []; |
This file contains 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
nREPL server started on port 64499 on host 127.0.0.1 - nrepl://127.0.0.1:64499 | |
REPL-y 0.3.1 | |
Clojure 1.7.0-alpha6 | |
Reflection warning, /tmp/form-init8946539659736038022.clj:1:1389 - reference to field ns can't be resolved. | |
Reflection warning, /tmp/form-init8946539659736038022.clj:1:3631 - reference to field name can't be resolved. | |
Docs: (doc function-name-here) | |
(find-doc "part-of-name-here") | |
Source: (source function-name-here) | |
Javadoc: (javadoc java-object-or-class-here) | |
Exit: Control+D or (exit) or (quit) |
This file contains 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
(ns om.next.spec | |
(:require [cljs.spec :as s])) | |
(s/def ::ident (s/and vector? (s/cat :ident keyword? :value #(not (coll? %))))) | |
(s/def ::join-key (s/or :prop keyword? :ident ::ident)) | |
(s/def ::join (s/and (s/map-of ::join-key ::query) #(= (count %) 1))) | |
(s/def ::union (s/and (s/map-of keyword? ::query) #(> (count %) 1))) | |
(s/def ::param-expr | |
(s/cat :query-expr ::query-expr |
This file contains 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
(ns om.next.spec | |
(:require [cljs.spec :as s] | |
[clojure.test.check :as tc] | |
[clojure.test.check.properties :as tcp])) | |
(s/def ::statics | |
(s/cat | |
:static '#{static} | |
:protocol-name '#{om.next/Ident om.next/IQuery om.next/IQueryParams} | |
:impls (s/* seq?))) |
This file contains 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
import React from 'react' | |
import { render } from 'react-dom' | |
import { Match, Link, BrowserRouter as Router } from 'react-router' | |
import matchSorter from 'match-sorter' | |
import './styles.css' | |
const API = 'http://localhost:3000' | |
const token = localStorage.booksToken || Math.random().toString() | |
localStorage.booksToken = token |