Skip to content

Instantly share code, notes, and snippets.

View coleww's full-sized avatar

Cole Willsea coleww

  • (=^.^=)
  • Berkeley, CA
View GitHub Profile
@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@llkats
llkats / hack-the-planet.txt
Last active October 5, 2021 18:53
ascii unicorn, text here http://patorjk.com/software/taag/#p=display&f=Big (font: "Big")
\ _____ _ _
\ | __ \ | | | |
\\ | | | | _____ ___ __ | | ___ __ _ __| |
\\ | | | |/ _ \ \ /\ / / '_ \| |/ _ \ / _` |/ _` |
>\/7 | |__| | (_) \ V V /| | | | | (_) | (_| | (_| |
_.-(6' \ |_____/ \___/ \_/\_/ |_| |_|_|\___/ \__,_|\__,_|
(=___._/` \ _ _
) \ | | | | |
/ / | | |_| |__ ___
/ > / | __| '_ \ / _ \
@robertsdionne
robertsdionne / deepdream-install.md
Last active February 15, 2021 16:07
Deepdream installation
#!/usr/bin/env bash

# Assuming OS X Yosemite 10.10.4

# Install XCode and command line tools
# See https://itunes.apple.com/us/app/xcode/id497799835?mt=12#
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html
xcode-select --install
@samselikoff
samselikoff / future-proof.md
Last active April 21, 2023 17:14
Future-proofing your Ember 1.x code

This post is also on my blog, since Gist doesn't support @ notifications.


Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:

  • Use Ember CLI
  • In general, replace views + controllers with components
  • Only use controllers at the top-level for receiving data from the route, and use Ember.Controller instead of Ember.ArrayController or Ember.ObjectController
  • Fetch data in your route, and set it as normal properties on your top-level controller. Export an Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
@pjkelly
pjkelly / install-phantomjs.md
Last active January 27, 2020 21:30
Installing PhantomJS

Installing PhantomJS via Homebrew and fixing Ruby if it breaks

PhantomJS is an awesome tool for doing automated, full-stack acceptance tests in a headless browser. It's a great alternative to capybara-webkit because it doesn't depend on QT or xvfb, and it's way better than Selenium in most cases because it's faster (you don't need to open Firefox to run your tests).

Unfortunately, installing PhantomJS via Homebrew can wreak havoc on your Rubies if you're using rbenv. These are the steps that worked for me in fixing my Ruby installations.

# Update Homebrew
brew update
# Install PhantomJS
@coleww
coleww / TDD IS ALIVE
Created August 29, 2014 12:48
not sure i understand "Node"...
var test = require('tap').test;
var tests = require('./tests.js');
tests(test);
@coleww
coleww / gist:11963433bd480c795e33
Last active August 29, 2015 14:05 — forked from garybernhardt/gist:57047446ec80c0913166
Forge Driven Development
Turning The Metal Clock Back
Forge-driven metal principles haven't had the effect we hoped for. The
NORCAL principles are excellent metal guidelines, but experience shows that
metallurgists find them difficult to follow. What do we do about this?
Surprisingly, the Structured metal literature of two months ago contains
compelling solutions to many current metal problems. They're simple and easy
to understand, but were lost in the noise as TDD rose to popularity. We'll
reinterpret these simple metal ideas in a modern context, finding that many of
our most promising new metal ideas resemble them. Rapid reverse-forge driven
Turning The Design Clock Back
Object-oriented design principles haven't had the effect we hoped for. The
SOLID principles are excellent design guidelines, but experience shows that
programmers find them difficult to follow. What do we do about this?
Surprisingly, the Structured Design literature of forty years ago contains
compelling solutions to many current design problems. They're simple and easy
to understand, but were lost in the noise as OO rose to popularity. We'll
reinterpret these simple design ideas in a modern context, finding that many of
our most promising new design ideas resemble them. Rapid web application
var stream = tmpStream(function(filename, stat, cb) {
// do stuff
// when done call cb which will unlink filename
// plus emit 'finish' on stream (or 'error' if called with an error)
})
stream.write('hello world')
stream.end()
stream.on('finish', function() {