Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| <?php | |
| namespace tests\unittests\custom; | |
| /** | |
| * Whenever PHP HTTP stream is used you can | |
| * inject a mock stream resource into an object that | |
| * expect it. | |
| * | |
| * Usage example: | |
| * | |
| * ... |
| //Please note I'm also using underscore each function for the iterations | |
| //iCal -> jsCal | |
| var icalEvents = ICal.parse(iCalStringData); | |
| //jsCal->Component | |
| var comp = new Component(icalEvents[1]); | |
| //Get all VTIMEZONE iCalendar components | |
| var vtimezones = comp.getAllSubcomponents("vtimezone"); | |
| //Add all timezones in iCalendar object to TimezonService |
| #!/usr/bin/env ruby | |
| # encoding: UTF-8 | |
| @dot_cycle = ['⣾','⣽','⣻','⢿','⡿','⣟','⣯','⣷'] | |
| #braille random: 0x2800 - 0x28ff | |
| @z_arrow = ['←','↖','↑','↗','→','↘','↓','↙'] | |
| @z_b = ['b','ᓂ','q','ᓄ'] | |
| @z_d = ['d','ᓇ','p','ᓀ'] |
| FROM ubuntu | |
| MAINTAINER David Weinstein <[email protected]> | |
| # install our dependencies and nodejs | |
| RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list | |
| RUN apt-get update | |
| RUN apt-get -y install python-software-properties git build-essential | |
| RUN add-apt-repository -y ppa:chris-lea/node.js | |
| RUN apt-get update | |
| RUN apt-get -y install nodejs |
| // Create our own MyResponseWriter to wrap a standard http.ResponseWriter | |
| // so we can store the status code. | |
| type MyResponseWriter struct { | |
| status int | |
| http.ResponseWriter | |
| } | |
| func NewMyResponseWriter(res http.ResponseWriter) *MyResponseWriter { | |
| // Default the status code to 200 | |
| return &MyResponseWriter{200, res} |
| package main | |
| /** | |
| * @website http://albulescu.ro | |
| * @author Cosmin Albulescu <[email protected]> | |
| */ | |
| import ( | |
| "bytes" | |
| "fmt" |
As we all know, Go 2 is on its way and despite the hesitations, it's clear that without generics, it would end up being a disappointment. And although we are still gathering real-life use-cases, or experience reports, there's nothing bad about starting to think about how generics in Go could look like. I've come up with a few ideas which I'd love to share. So, here we go!
Now, Go 1 has no generics, but has interfaces. Interfaces (sometime accompanied by reflection)