Skip to content

Instantly share code, notes, and snippets.

View nopresnik's full-sized avatar

Nathan Opresnik nopresnik

  • Melbourne, Australia
View GitHub Profile
@nopresnik
nopresnik / query.sql
Last active May 6, 2024 05:50
B2B redemption report
SELECT o.Name AS 'OrganisationName', u.EmailAddress, u.FirstName, u.LastName, u.Status, u.CreatedAt
FROM User u
LEFT JOIN Organisation_User ou ON u.Id = ou.UserId
LEFT JOIN Organisation o ON ou.OrganisationId = o.Id
WHERE ou.OrganisationId = 'RbVYBJSsqsRksbHC'
AND u.Password IS NULL
@nopresnik
nopresnik / reOrder.ts
Created November 19, 2021 08:33
Re order a list of people and persist it in the person object
interface Person {
order: number;
name: string;
}
function reOrderPeople(people: Person[], person: Person, newOrder: number) {
const personIndex: number = people.findIndex((l) => l.name === person.name);
people.splice(personIndex, 1);
people.splice(newOrder - 1, 0, person);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
{"type":"Topology","arcs":[[[857662,292861],[-857,259],[-1,20],[-2,46],[-80,383],[40,288],[-40,183],[85,215],[29,6],[125,30],[16,132],[-533,113],[-476,452],[-247,37],[40,250],[-36,6],[-250,107],[-44,753],[-314,334],[-175,397],[0,2],[-711,107],[-930,140],[-1113,168],[-2172,327],[-307,47],[-374,54],[-497,72],[-239,36],[-730,109],[-6,25],[-1801,268],[-302,46],[99,-189],[-738,-1889],[-160,-409],[-10,6]],[[844951,295792],[-34,29],[-36,27]],[[844881,295848],[-34,28],[-35,25],[-38,24],[-33,29],[-35,24],[-32,29],[-35,25],[-29,32],[-8,6],[-22,18],[-16,10],[-18,12],[-18,11],[-11,8],[0,7],[-1,11],[0,15],[5,48],[0,3],[0,2],[-1,2],[-1,4],[-13,36],[-2,11],[-1,4],[0,5],[0,2],[0,3],[-12,4],[-9,5],[-11,10],[-78,42],[-11,7],[-18,7],[-4,2],[-19,28],[-2,5],[-2,2],[-2,3],[-2,3],[-2,4],[-14,21],[-11,13],[-16,18],[-4,6],[-2,6],[0,6],[1,10],[0,5],[0,20],[3,41],[3,26],[6,25],[7,31],[13,45],[14,45],[1,8],[0,6],[-6,7],[-12,14],[-9,10],[-7,6],[-7,5],[-8,4],[-2,2],[-8,4],[-2,2],[-10,9],[-20,17],[-18,13],[-15,11],[-31,23],[-33,22],[-5,4],
public static void CreateFolders(Job job)
{
var path = "J:\\" +
JobFolderRange(job.JobNumber, 1000) + "\\" +
job.JobNumber + " " +
job.Client + " " +
job.Address;
CreateDirectory(path);
}
@nopresnik
nopresnik / Brunswick GS Parts.csv
Last active July 22, 2023 01:45
Brunswick GS series pinsetter parts list pulled from parts manual
Part Description
47-011053-004 Deflection Chain Gear w/Bearing Complete
11-051772-001 Lockwasher (12 mm)
47-011130-004 Bearing Bolt
47-011245-003 Lower Chain Guide
11-052601-001 Carriage Bolt (8 mm x 30 mm)
11-051704-001 Hex Nut (8 mm)
11-051770-001 Lockwasher (8 mm)
47-011135-000 N.A. Elevator Frame w/Felt Backing
47-011276-003 Upper Chain Guide
@nopresnik
nopresnik / getting-started.md
Created June 12, 2018 05:09 — forked from joepie91/getting-started.md
Getting started with Node.js

"How do I get started with Node?" is a commonly heard question in #Node.js. This gist is an attempt to compile some of the answers to that question. It's a perpetual work-in-progress.

And if this list didn't quite answer your questions, I'm available for tutoring and code review! A donation is also welcome :)

Setting expectations

Before you get started learning about JavaScript and Node.js, there's one very important article you need to read: Teach Yourself Programming in Ten Years.

Understand that it's going to take time to learn Node.js, just like it would take time to learn any other specialized topic - and that you're not going to learn effectively just by reading things, or following tutorials or courses. _Get out there and build things!

@nopresnik
nopresnik / Tutorial.md
Created June 11, 2018 12:28 — forked from vemacs/Tutorial.md
Instructions for setting up a Spigot server using mark2 on a fresh Ubuntu Server 14.04 LTS install.

Prerequisites

  • a vswap OpenVZ VPS or a KVM/Xen/VMware VPS with Ubuntu Server 14.04 LTS installed (architecture doesn't matter), or a dedicated server
  • patience and a willingness to learn
  • approximately 10 minutes of time

Why Ubuntu LTS?

*:/lsd = >>>
_assertperm(restricted, 1)
set_peffect(player(), 9, 1, 30)
msg('§1§k-§5§k-§a§k-§f§k-§4§k-§8§k-§0§k-§c§k-§f§k-§1§k-§9§k-§a§k-§3§k-§0§k-§4§k-§f§k-§b§k-§d§k-§9§k-§d§k-§f§k-§e§k-§0§k-§d§k-§d§k-§a§k-§3§k-§0§k-§4§k-§a§k-§a§k-§2§k-§3§k-§e§k-§7§k-§5§k-§1§k-§f§k-§8§k-§4§k-§4§k-§0§k-§d§k-§9§k-§3§k-§4§k-§5§k-§6§k-§e§k-§2§k-§e§k-§f§k-§4§k-§c§k-§0§k-§b§k-§a§k-§8§k-§4§k-§4§k-§d§k-§6§k-§4§k-§a§k-§a§k-§8§k-§2§k-§9§k-§b§k-§b§k-§0§k-§f§k-§e§k-§6§k-§6§k-§3§k-§c§k-§8§k-§0§k-§8§k-§d§k-§8§k-§d§k-§6§k-§5§k-§7§k-§f§k-§a§k-§9§k-§e§k-§d§k-§c§k-§b§k-§d§k-§0§k-§a§k-§6§k-§6§k-§a§k-§d§k-§e§k-§7§k-§a§k-§d§k-§3§k-§4§k-§3§k-§8§k-§7§k-§3§k-§4§k-§9§k-§a§k-§b§k-§a§k-§8§k-§b§k-§2§k-§3§k-§e§k-§7§k-§3§k-§4§k-§7§k-§6§k-§0§k-§3§k-§d§k-§8§k-§e§k-§c§k-§5§k-§9§k-§2§k-§5§k-§f§k-§2§k-§8§k-§8§k-§9§k-§b§k-§d§k-§a§k-§e§k-§6§k-§7§k-§8§k-§b§k-§e§k-§1§k-§9§k-§d§k-§1§k-§b§k-§1§k-§b§k-§f§k-§f§k-§b§k-§d§k-§2§k-§e§k-§6§k-§e§k-§7§k-§1§k-§f§k-§4§k-§4§k-§c§k-§9§k-§b§k-§a§k-§a§k-§8§k-§b§k-§8§k-§5§k-§3§k-§e§k-§f§k-§b§k-§4§k-§4§k-§d§k-§5§k-§a§k-§f§k-§
public class Events implements Listener {
HashMap<String, Long> cooldownJump = new HashMap<String, Long>();
HashMap<String, Long> cooldownSponge = new HashMap<String, Long>();
public JMod plugin;
public Events(JMod instance) {
plugin = instance;
}