Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Single Product Image
*
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-image.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
bot.command(:top10, in: "ma-fakka", description: "!top10") do |event|
db = DB.new
res = db.top10
this_res = res.each_with_index.map { |r| "#{r['displayName']} #{r['gameScore']}" }
// Print result from MySQL result like this
// 1. name score
// 2. name score
// 3. name score
event.respond this_res
end
AskMeBOT - Yesterday at 1:11 PM
TOP 10 LEADERBORDS
madlzm 2200000.0
thmzz 2000000.0
dante 1900000.0
[<Message content="madlzm 2200000.0" id=248782233337462786 timestamp=2016-11-17 13:11:46 +0100 author=#<Discordrb::User:0x00000101eafa90> channel=#<Discordrb::Channel:0x00000101eafe50>>, <Message content="thmzz 2000000.0" id=248782234205552641 timestamp=2016-11-17 13:11:46 +0100 author=#<Discordrb::User:0x00000101eafa90> channel=#<Discordrb::Channel:0x00000101eafe50>>, <Message content="dante 1900000.0" id=248782234796949505 timestamp=2016-11-17 13:11:46 +0100 author=#<Discordrb::User:0x00000101eafa90> channel=#<Discordrb::Channel:0x00000101eafe50>>]
bot.command(:getid, max_args: 1, in: "#channel", from: ["thmzz"], description: "Get the ID of the person selected") do |event, *args|
name = args[0]
event.respond THE_ID_OF_THE_NAME
end
class RegistrationsController < Devise::RegistrationsController
before_filter :configure_permitted_parameters, if: :devise_controller?
#def new
#flash[:error] = 'Registrations are not open yet, but please check back soon'
# nil
# render 'static_pages/_sign_up_not_allowed'
#end
private
/dev/mapper/vg_server1-lv_root / ext4 defaults,usrquota 1 1
UUID=7c472404-882c-4943-b54b-b23949c9ee98 /boot ext4 defaults 1 2
/dev/mapper/vg_server1-lv_home /home ext4 defaults,usrquota 1 2
/dev/mapper/vg_server1-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults,noexec,nosuid 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/usr/tmpDSK /tmp ext3 defaults,noauto 0 0
thomass@filserver:~$ nmap -Pn 64.5.98.132
Starting Nmap 5.21 ( http://nmap.org ) at 2013-11-13 19:28 CET
Nmap scan report for apollo.mavieo.com (64.5.98.132)
Host is up (0.22s latency).
All 1000 scanned ports on apollo.mavieo.com (64.5.98.132) are filtered (959) or closed (41)
Nmap done: 1 IP address (1 host up) scanned in 22.00 seconds
def self.validate_hour(p_id, date_selected, a_id, start_at, end_at)
where {
(project_id == p_id) & (date_today == date_selected) & (admin_id == a_id) & (from >= start_at) & (from <= end_at) |
(project_id == p_id) & (date_today == date_selected) & (admin_id == a_id) & (from <= start_at) & (to >= end_at) |
(project_id == p_id) & (date_today == date_selected) & (admin_id == a_id) & (to >= start_at) & (to < end_at) |
(project_id == p_id) & (date_today == date_selected) & (admin_id == a_id) & (start_at >= end_at)
}.count()
end
SQLite3::SQLException: near "to": syntax error: SELECT 1 AS one FROM "registerhours" WHERE (registerhours.to >= '2013-10-15 16:00:00.000000' AND registerhours.from <= '2013-10-15 17:00:00.000000') ORDER BY created_at DESC LIMIT 1
class Registerhour < ActiveRecord::Base
before_save :check_hours
belongs_to :project
belongs_to :admin
validates_presence_of :project, :timetype
validate :from_time_cannot_be_after_to_time
def from_time_cannot_be_after_to_time
if from.present? && from >= to