Skip to content

Instantly share code, notes, and snippets.

View olvrb's full-sized avatar

Oliver Boudet olvrb

  • Luleå
View GitHub Profile
@olvrb
olvrb / app.js
Created August 18, 2017 08:26
Simple, complete example of a bot in Discord.js
// Load up the discord.js library
const Discord = require("discord.js");
// This is your client. Some people call it `bot`, some people call it `self`,
// some might call it `cootchie`. Either way, when you see `client.something`, or `bot.something`,
// this is what we're refering to. Your client.
const client = new Discord.Client();
// Here we load the config.json file that contains our token and our prefix values.
const config = require("./config.json");

Keybase proof

I hereby claim:

  • I am olvrb on github.
  • I am olvrb (https://keybase.io/olvrb) on keybase.
  • I have a public key ASD7QdExHMuN1ug414ApyMMQ8-bmv9_6xDBj0DymbZR6EQo

To claim this, I am signing this object:

firstloop:for (x=1;x<10;x++) { nestedloo:for (y=1; y<200;y++) {const fall1= 456*x + (y > 100 ? 2.4*y : 0 ); const fall2 = 345*x+1.5*y; if (fall1 < fall2){break firstloop;} console.log(`fall 1: 456*${x} + ${(y > 100 ? 2.4*y : 0 )} = ${fall1}`); console.log(`fall 2: ${fall2}`)} }
nestedloo:for(y=1; y<200;y++){const fall1=Math.floor(456*x+(y>100?2.4*y:0));const fall2=Math.floor(345*x+1.5*y);if(fall1 < fall2){console.log(`${x}, ${y}`); break nestedloo;}console.log(`fall 1: 456*${x} + ${(y>100?2.4*y:0)} = ${fall1}`);console.log(`fall 2: ${fall2}`)}
@olvrb
olvrb / cloudSettings
Created August 12, 2018 15:03
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-08-12T15:03:11.656Z","extensionVersion":"v3.0.0"}
object: System.Object
string: System.String
bool: System.Boolean
byte: System.Byte
sbyte: System.SByte
short: System.Int16
ushort: System.UInt16
int: System.Int32
uint: System.UInt32
long: System.Int64
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_yourdomain {
server 127.0.0.1:2368;
keepalive 8;
}
server {
listen 0.0.0.0:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
@olvrb
olvrb / index.js
Created October 25, 2018 13:48
get deriv of function
const readline = require("readline-sync");
let equation = readline.question("equation > ");
equation = equation.split(/ /g);
let eq = "";
for (const term of equation) {
if (term.match(/(\+|-)/g)) {
eq += term;
continue;
}
@olvrb
olvrb / main.py
Created November 20, 2018 21:59
don't hold my beer
sha256 = lambda data: [([
[
[
[([w.append((gamma1(w[-2]) + w[-7] + gamma0(w[-15]) + w[-16]) & 0xffffffff) for _ in range(48)] and False) or[([
[
[
[g.__setitem__(j, values[j]) for j in range(8)]
for values in [
[(t1 + t2) & 0xffffffff, g[0], g[1], g[2], (g[3] + t1) & 0xffffffff, g[4], g[5], g[6]]
]
using System.Collections.Generic;
using System.Linq;
namespace FallProject.Utilities {
public static class Base64Utilities {
// Credits to https://stackoverflow.com/a/11743162/8611114.
// Extension method, just in case I need it later.
public static string Base64Encode(this string plainText) {