A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
#!/bin/bash | |
if [ $1 = "love" ]; then | |
if [ "$EUID" -ne 0 ]; then | |
echo "i have a boyfriend" | |
else | |
echo "i love $2 too" | |
fi | |
fi |
<?php layout("Title goes here"){ ?> | |
Content in here should yield into the body | |
<?php } ?> |
class FaviconFinder | |
require 'open-uri' | |
attr_accessor :favicon_url | |
def initialize domain = "example.com" | |
@favicon_url = nil | |
["/favicon.ico", "/favicon.png"].each do |file| | |
url = "http://#{domain}#{file}" | |
uri = URI(url) |
class FooBarController < ApplicationController | |
before_action :set_stuff | |
def create | |
# same as below | |
@bar.foods.add(@foo) | |
end | |
def destroy | |
# remove beeing a method on the foo object here |
// I think it semi embeds gists | |
// Does it? |
require 'json' | |
require 'uri' | |
require 'net/http' | |
require 'net/https' | |
## | |
# Poloniex Ruby API interface | |
# | |
# Documentation text is pretty much 1:1 from the official API documentation | |
# https://www.poloniex.com/support/api |
curl --data "text=Hi there&key=<%= current_api_key %>&media[]=https://example.com/image1.jpg&media[]=https://example.com/image2.jpg" https://tweee.co/api/tweet |
<%= form_tag "https://#{Rails.env.development? ? "url.com" : "other.ch"}/@@search", method: :get, id: "quick-search", role: "search" do %> | |
<div class="input-group"> | |
<input type="hidden" name="facet" value="true"> | |
<input type="hidden" name="fq" value='site_area:"Kantonsratsgeschäfte"'> | |
<input type="hidden" name="facet.field" value="object_type"> | |
<input type="hidden" name="facet.field" value="topics"> | |
<%= text_field_tag :SearchableText, "", placeholder: t("navigation.search.placeholder"), class: "form-control" %> | |
<span class="input-group-btn"> | |
<button class="btn btn-secondary" id="search_submit" type="submit"> | |
<span class="glyphicon glyphicon-search"></span> |