Skip to content

Instantly share code, notes, and snippets.

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
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(: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
<?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
<?php
function splitapng($data) {
$parts = array();
// Save the PNG signature
$signature = substr($data, 0, 8);
$offset = 8;
$size = strlen($data);
while ($offset < $size) {
// Read the chunk length
#<RUBG::Participant:0x007f91bdd414c0 @participant_id="77e81b3a-b646-4f98-bf98-5588c3b7d508", @actor="", @shard="pc-na", @dbnos=8, @assists=0, @boosts=3, @damage_dealt=942.960144, @death_type="byplayer", @headshot_kills=2, @heals=14, @kill_place=1, @kill_ranking_before=1000, @kill_ranking_gained=0, @kill_streaks=3, @kills=10, @last_kill_points=0, @last_win_points=0, @longest_kill=57.8827133, @most_damage=0, @name="StoneMountain64", @player_id="account.6c30f024b3ec4283baefd39f3cb5694e", @revives=0, @ride_distance=0, @road_kills=1, @team_kills=0, @time_survived=1385.811, @vehicle_destroys=0, @walk_distance=3190.1543, @weapons_acquired=11, @win_place=14, @win_ranking_before=1500, @win_ranking_gained=0, @overall_ranking_gained=0, @stats={"DBNOs"=>8, "assists"=>0, "boosts"=>3, "damageDealt"=>942.960144, "deathType"=>"byplayer", "headshotKills"=>2, "heals"=>14, "killPlace"=>1, "killPoints"=>1000, "killPointsDelta"=>0, "killStreaks"=>3, "kills"=>10, "lastKillPoints"=>0, "lastWinPoints"=>0, "longestKill"=>57.8827133,
@thomasstr
thomasstr / app.js
Last active October 23, 2018 07:30
const connection = require('./knex/MySQL');
var checkUser = conncetion.userExists("226018734496546817")
if (checkUser == 1) {
console.log("User exists");
else {
connection.createUser({
name: "Thomas Strømme",
id: "226018734496546817"
var express = require('express')
, session = require('express-session')
, passport = require('passport')
, Strategy = require('./lib').Strategy
, app = express()
, path = require('path')
, engines = require('consolidate')
const conn = require('./knex/MySQL');
passport.serializeUser(function(user, done) {
/* Hello World OLED Test */
#include "SSD1306.h" // alias for `#include "SSD1306Wire.h"`
SSD1306 display(0x3c, 4, 5); // Initialise the OLED display using Wire library (D2 and D1 on NodeMCU)
void setup()
{
Serial.begin(9600);
display.init(); // Initialising the UI will init the display too.
display.flipScreenVertically();
display.normalDisplay();
var arr = ["User1", "User2", "User3"];
message.channel.send({embed: {
color: 3447003,
author: {
name: client.user.username,
icon_url: client.user.avatarURL
},
title: "This is an embed",
url: "http://google.com",