Skip to content

Instantly share code, notes, and snippets.

@ogryzek
ogryzek / character_config.md
Last active March 14, 2022 21:08
Some Character Config Settings for Kolbot

Character Config for Kolbot - Quick Reference

Attack skill reference

General

Inventory

0 to not touch, 1 if you don't care about that slot:

<h1><%= @name_plural %></h1>
<%% @<%= @name_plural %>.each do |<%= @name_singular %>| %>
<li><a href="/<%= @name_plural %>/<%%= <%= @name_singular %>.id %>"><%%= <%= @name_singular %>.id %></a></li>
<ul>
<%%= @attributes.each do |attribute| %>
<li><%%= attribute %>: <%%= <%= @name_singular %> %>.<%%= attribute %></li>
<%% end %>
</ul>
<%% end %>
</ul>
require 'sinatra'
# require and use controllers from within the `./controller` directory
controller_paths = Dir["./controllers/*.rb"].each { |file| require_relative file }
controllers = controller_paths.map { |controller_path| controller_path[/controllers\/(.*?)_controller/m, 1] }
controllers.each { |controller| use Object.const_get("#{controller.capitalize}Controller") }
@ogryzek
ogryzek / social_meta.html
Created February 22, 2014 18:47
Social media meta tags reference: Thanks to https://twitter.com/j_holtslander
<html>
<head>
<title>__________</title>
<!--[if lt IE 9]>
<script src="https://raw.github.com/aFarkas/html5shiv/master/src/html5shiv.js"></script>
<![endif]-->
<meta charset="utf-8">
<meta name="robots" content="noarchive"> <!-- Noarchive will prevent Google caching the page. -->
<meta name="keywords" data-page-subject="true" content="keyword,keyword,keyword,keyword,keyword,keyword,keyword" /> <!-- Relevant Keywords -->
<link rel="shortcut icon" href="favicon.ico">
@ogryzek
ogryzek / databases_with_mapper.md
Last active December 7, 2019 08:03
Databases with Mapper

Databases with Mapper

With what we did yesterday, we were saving everything in memory, so after the request response happens, everything is gone.

To save data from the user, we have different options. We can save the data just to a file. The problem with this is it bcomes slow, and becomes problmeatic, because, what if lots of users are opening the same file at the same file, and searching through a file can become quite slow.

With databases, you structure your data, you put it in a structured fashion. You can easily store and retrieve your data. There are two main database structures. One is called a relational database, and the other is called NoSQL. We may go over a NoSQL DB like MongoDB on a Saturday or something, but for the most part, we will be focusing on relational databases.

NoSQL databases use key values, documents, different ways to store data. Relational databases use a langauge called SQL, which is a language used to query, fetch, and store data in databases. The one we are going to

@ogryzek
ogryzek / sinatra.md
Last active August 3, 2019 06:14
Sinatra and Ruby Gems

#Sinatra

Ruby Gems

Ruby Gems
There are over 72,000 gems. There's is probably a gem available for whatever it is you want to do. Let's try installing a gem called "snooby". In your terminal, try gem install snooby.
If you are having difficulty with installing gems, try installing a ruby version management tool, such as RVM

1.) Find a gem that allows you to print something in IRB in color.

gem install colorize
General:
0 - Attack
1 - Kick
2 - Throw
3 - Unsummon
4 - Left Hand Throw
5 - Left Hand Swing
Amazon:
6 - Magic Arrow
// 1.) Write a function `cigs()` that takes an argument `perHour`, and
// logs "You smoke (however many perHour) cigs per hour."
function cigs(perHour) {
first = "You smoke ";
middle = perHour;
last = " cigs per hour.";
msg = first + middle + last;
console.log(msg);
}
@ogryzek
ogryzek / aws_shippable_docker.md
Last active November 24, 2017 16:27
code_snippets
@ogryzek
ogryzek / log_example.go
Last active July 15, 2016 23:02
Messing around with writing logs to a file in Go (Golang)
// log_example.go
package main
import (
"fmt"
mypackage "github.com/ogryzek/log_practice/mypackage"
"log"
"net/http"
"os"
)