Skip to content

Instantly share code, notes, and snippets.

View stephenbaldwin's full-sized avatar

Stephen Baldwin stephenbaldwin

View GitHub Profile
@avafloww
avafloww / PhpJava.java
Last active June 13, 2024 07:36
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();
#!/bin/bash
#
# (1) copy to: ~/bin/ssh-host-color
# (2) set: alias ssh=~/bin/ssh-host-color
#
# Inspired from http://talkfast.org/2011/01/10/ssh-host-color
# Fork from https://gist.github.com/773849
#
set_term_bgcolor(){

Stephen's Shitlist

Person/Place/Thing Shit-storm level (tm)
Obama / Healthcare ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
ERB and HAML templates ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
Matt Newton Metaprogramming ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
T-Mobile ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
Ruby Hash Rockets ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
PHP Developers ![1][poo] ![2][poo] ![3][poo] ![4][poo] ![5][poo]
@dblock
dblock / action_mailer_with_text_part.rb
Created May 17, 2012 14:57
Insert an automatic text MIME part into HTML e-mail.
#
# Insert an automatic text MIME part into HTML e-mail.
# (c) Daniel Doubrovkine, Art.sy 2012
# MIT License
#
class ActionMailerWithTextPart < ActionMailer::Base
def collect_responses_and_parts_order(headers)
responses, parts_order = super(headers)
html_part = responses.detect { |response| response[:content_type] == "text/html" }