Skip to content

Instantly share code, notes, and snippets.

# Viking Academy Coding challenge
def not_string(input)
if input.partition(" ").first == "Not" || input.partition(" ").first =="not"
puts input
else
puts "not #{input}"
end
end
@ekumachidi
ekumachidi / Overlay pictures.html
Created February 27, 2017 08:24
Overlay pictures
<!-- Sample code to overlay pictures -->
<div class="height-100vh center-aligned">
<!-- Background image or banner -->
<img class="background-image" src="http://i.imgur.com/1aBfM.png" />
<!-- Uploaded image -->
<img src="http://i.imgur.com/DH3Qw.png" class="text">
</div>
<style type="text/css">
body {
<!-- export div to png -->
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<span id="widget" class="widget" field="AGE" roundby="20" description="Patient age, in years">
<div class="header ng-scope">
<div class="title ng-binding">AGE</div>
<div class="container">
<div class="row">
<div>
PRICING
</div>
<div class="span3">
<div class="well">
<h2 class="muted">Starter</h2>
<p><span class="label">POPULAR</span></p>
<ul>
<div class="row ">
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
<div class="db-wrapper">
<div class="db-pricing-seven">
<ul>
<li class="price">
<i class="glyphicon glyphicon-qrcode"></i>
STARTER - $0 / month
</li>
@ekumachidi
ekumachidi / gist:aac9316496fb2ca84dcef00920fede9b
Created May 28, 2016 15:00
Create new postgres super user
Run this
"sudo -u postgres psql"
in your terminal to get into postgres
postgres=#
Run "CREATE USER new_username;"
Note: Replace new_username with the user you want to create,
@ekumachidi
ekumachidi / API.md
Created April 21, 2016 07:57 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

CREATE TABLE Roles (
id SERIAL PRIMARY KEY,
name TEXT,
created_at TIMESTAMP,
updated_at TIMESTAMP
);
CREATE TABLE users
(
id serial NOT NULL,
def new
@user = User.new
@package = Package.all
end
def create
@user = user.new(user_params)
if @user.save
redirect_to :action => ‘list’
else