Skip to content

Instantly share code, notes, and snippets.

@doobee46
doobee46 / Pig_latin
Created November 19, 2012 23:55
Test driven developement
require "pig_latin"
describe "#translate" do
it "translates a word beginning with a vowel" do
s = translate("apple")
s.should == "appleay"
end
it "translates a word beginning with a consonant" do
<?php
include('inc/db_connect.php');
//display table value in a list for table view
try
{
$sql = "SELECT ID, GroupName, VideoTITLE, ByArtist FROM videoclip";
$result = $pdo->query($sql);
}
catch(PDOException $e)
@doobee46
doobee46 / example
Created July 21, 2013 14:01
example
<script src="js/script.js"></script>
for (var i=1; i <= 100; i++)
{
if (i % 15 == 0)
console.log("Ping-Pong");
else if (i % 3 == 0)
console.log("Ping");
else if (i % 5 == 0)
console.log("Pong");
else
console.log(i);
@doobee46
doobee46 / dokku_setup.md
Last active August 29, 2015 14:26 — forked from ungoldman/dokku_setup.md
Setting up Dokku with DigitalOcean and Namecheap

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.

This write-up owes a great deal to dscape's Node.js Deployments with Docker, Dokku, & Digital Ocean, the dokku project itself, and the fine folks working on dokku's issues. I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

1. Get a domain

require 'will_paginate/view_helpers/link_renderer'
module WillPaginate
module ViewHelpers
class LinkRenderer
protected
def page_number(page)
page == current_page ? tag(:span, page, class: 'active item') : link(page, page, class: 'item', rel: rel_value(page))
end
@doobee46
doobee46 / Gemfile
Last active August 29, 2015 14:26 — forked from adamrobbie/Gemfile
Rails Endless pagination
gem 'will_paginate'
@doobee46
doobee46 / json_response_handling_ruby.rb
Created April 22, 2016 00:34 — forked from PWSdelta/json_response_handling_ruby.rb
Ruby script that uses open-uri to fetch the contents of a JSON endpoint, uses the JSON gem to parse the string into a Ruby array & prints some of the records. This is the foundation for all web API requests, so feel free to use it in the future.
# http://ruby-doc.org/stdlib-2.0.0/libdoc/open-uri/rdoc/OpenURI.html
require 'open-uri'
# https://github.com/flori/json
require 'json'
# http://stackoverflow.com/questions/9008847/what-is-difference-between-p-and-pp
require 'pp'
# Construct the URL we'll be calling
request_uri = 'http://localhost:3000/users.json'
request_query = ''
import { Component } from '@angular/core';
import { NavController, NavParams, Events} from 'ionic-angular';
//import { HomePage } from '../home/home';
//import { VideoService} from '../../providers/video-service';
import { LoadingController } from 'ionic-angular';
import { SearchPage } from '../search/search';
import { MenuController } from 'ionic-angular';
import { ToastController } from 'ionic-angular';
import { VideodetailsPage } from '../videodetails/videodetails';
import { BackandService } from '../../providers/backandService';
Run this command to install MG-CLI:
sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb
to start miner (4 cores for BCN) use this command:
minergate-cli -user <YOUR@EMAIL.KAPPA> -bcn 4
Feel free to send some of your earnings to me:
BTC (Don't attempt to send other coins to this address!): 17f77AYHsQbdsB1Q6BbqPahJ8ZrjFLYH2j