Skip to content

Instantly share code, notes, and snippets.

View ninjayoto's full-sized avatar

ninjayoto

  • Canada
View GitHub Profile
@ninjayoto
ninjayoto / Growing A Discord Server.md
Created January 24, 2024 17:42 — forked from jagrosh/Growing A Discord Server.md
Tips for creating and growing a new Discord server

This guide is kept up-to-date as Discord and available resources change!
A basic server template is available here

Creating and Growing a Discord Server

logo

Introduction

Hello! I'm jagrosh#4824! I'm writing this guide to try to help new server owners set up and grow their servers, which is a commonly-requested topic. It's very easy to go about this the wrong way, so it's best to be prepared and make smart decisions so that your community can flourish!

Background

@ninjayoto
ninjayoto / letsencrypt-wildcard-renewal.md
Created January 17, 2023 16:51 — forked from Nimrodda/letsencrypt-wildcard-renewal.md
Setup automatic LetsEncrypt wildcard certificate renewal on Ubuntu server 18.04 with Namecheap

All credits go to by Bryan Roessler for his original post that I followed on how to setup LetsEncrypt wildcard certificate auto-renewal with Namecheap. I highly recommend you read his tutorial first and if you bump into issues, check out this gist next.

Unfortunately the original article is not up-to-date and doesn't have the option to leave comments so I can't communicate with the author for updates so I decided to write the updates in a Gist. I highlighted the sections that required an updated with Correction #:. I managed to get the correct setup with the help of the amazing guys at LetsEncrypt community. Here's the help thread.

Set up acme-dns

  1. Download acme-dns from https://github.com/joohoi/acme-dns/releases
  2. Move the binary somewhere sensible since we will be using
@ninjayoto
ninjayoto / add_item.php
Created June 14, 2022 00:13 — forked from davidtsadler/add_item.php
Example showing how to list an item to the eBay Sandbox using the eBay Accelerator Toolkit New Schema (EbatNS) for PHP.
<?php
/*
* Author: David T. Sadler (http://davidtsadler.com)
* Date: 2013-03-29
* License: I release this example into the public domain. Use at your own risk.
*
* Example showing how to list an item to the eBay Sandbox using the eBay Accelerator Toolkit New Schema (EbatNS) for PHP.
*
* This example uses version 815 released on the 2013-03-22.
* http://www.intradesys.de/en/system/files/its_downloads/EbatNs_1_0_815_P5_0.zip
@ninjayoto
ninjayoto / jq-cheetsheet.md
Created February 14, 2022 22:30 — forked from gillchristian/jq-cheetsheet.md
jq Chaet Sheet [cheat-sheet]

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@ninjayoto
ninjayoto / eBay average price
Created May 1, 2021 23:55 — forked from danomoseley/eBay average price
Find an average sold price of an eBay search.Do a search for a product, check the "Sold listings" option under "Show only" in the left navigation.Run this script by pasting it into the console tab of the chrome developer tools.
function Stats(arr) {
var self = this;
var theArray = arr || [];
//http://en.wikipedia.org/wiki/Mean#Arithmetic_mean_.28AM.29
self.getArithmeticMean = function() {
var sum = 0, length = theArray.length;
for(var i=0;i<length;i++) {
sum += theArray[i];
}
@ninjayoto
ninjayoto / QuickSort.java
Created September 7, 2020 16:57 — forked from jayeshsolanki93/QuickSort.java
QuickSort in Java
import java.util.Arrays;
import java.util.Scanner;
class QuickSort {
private static Scanner sc;
public static void main(String args[]) {
sc = new Scanner(System.in);
System.out.println("Enter no of terms");
@ninjayoto
ninjayoto / twitter4j-find-replies.java
Created September 20, 2019 16:28 — forked from ivamluz/twitter4j-find-replies.java
Code snippet showing how to post a reply to a tweet using twitter4j library
public static List<Status> findReplies() {
Query query = new Query("iluzcit");
List<Status> tweets = new ArrayList<Status>();
Twitter twitter = new TwitterFactory().getInstance();
try {
QueryResult result;
do {
result = twitter.search(query);
@ninjayoto
ninjayoto / avregex.md
Created April 8, 2019 03:09 — forked from eightyknots/avregex.md
AvReg: Aviation regex match toolkit

AvReg: The Aviation RegEx Match Toolkit

General Tips

  • The PCRE flavour of RegEx is used here.
  • Append the i modifier to the end of the regex to make any pattern case-insensitive.

Airline Codes

| Purpose | Description | RegEx | Example |

@ninjayoto
ninjayoto / aws-couchdb-setup.md
Created March 25, 2019 02:59 — forked from Ravenstine/aws-couchdb-setup.md
Fast CouchDB setup in AWS

Fast CouchDB setup in AWS

CouchDB is a NoSQL database for storing JSON documents. It comes with a REST API out of the box so your client applications can persist data while requiring you to write little or no server-side code. CouchDB's killer feature is its ability to easily replicate, which allows for horizontal scaling, easy backup, and for client adapters to synchronize documents. This is perfect if you want to write an application that is offline-first. It's become my go-to database when creating new

@ninjayoto
ninjayoto / EchoTest.java
Created February 7, 2019 17:50 — forked from chbaranowski/EchoTest.java
Cheat Sheet Test for Mockito
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.is;
import static org.mockito.Mockito.*;
import static org.mockito.BDDMockito.*;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;