Skip to content

Instantly share code, notes, and snippets.

⌨️
writing legacy code

Josh Ghent joshghent

⌨️
writing legacy code
Block or report user

Report or block joshghent

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joshghent
joshghent / mirror.sh
Created Aug 21, 2019
Mirror repos from gitlab to github
View mirror.sh
#!/bin/bash
repos=(repository1 repository2)
githubName="joshghent"
for repo in "${!repos[@]}"
do
reponame=${repos[repo]}
git clone git@gitlab.com:${githubName}/${reponame}.git
cd ${reponame}
View empty.py
#!/usr/bin/env python3
"""
Run the following
$ python3 empty.py
You need to install boto3 before by running `pip install boto3 --user`
"""
from __future__ import print_function
import argparse
View keybase.md

Keybase proof

I hereby claim:

  • I am joshghent on github.
  • I am joshghent (https://keybase.io/joshghent) on keybase.
  • I have a public key whose fingerprint is 0176 A8D5 896D F7FC CEDD 22B2 F8F3 7646 1CCA 4B50

To claim this, I am signing this object:

View sms-api.yml
openapi: 3.0.0
info:
description: "The SMS API is designed for integration partners to be able to send SMS messages and perform other actions related to SMS through the CloudCall platform"
version: "1.0.0"
title: "SMS API"
contact:
email: "integrations@cloudcall.com"
servers:
- url: https://ng-api.{platform}.cloudcall.com/v3/sms
variables:
View hi.md

◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️◻️:white_medium_sq

View graphite.ts
import { Client } from "node-statsd-client";
import { IGraphiteController } from "../interfaces";
const PREFIX = "MY-API-NAME";
export default class GraphiteController implements IGraphiteController {
private _client: any;
// the graphite port will always be this for every environment
private _port: number = 8125;
private static _instance: GraphiteController;
View router-stage-1.ts
import { Router } from "express";
import { Config } from "./configuration";
// Import or require the graphite controller and activity labels
import { GraphiteController, GraphiteLabel } from "../graphite";
const router = Router() as Router;
// Load your config
const config = Config.getConfig();
View graphite.ts
import { Client } from "node-statsd-client";
import { IGraphiteController } from "../interfaces";
const PREFIX = "MY-API-NAME";
export default class GraphiteController implements IGraphiteController {
private _client: any;
// the graphite port will always be this for every environment
private _port: number = 8125;
private static _instance: GraphiteController;
View main.php
$string = "floccinaucinihilipilification";
// First split the string to an array and then get the unique characters so we don't double count
$characters = array_unique(str_split($string));
$count = [];
// Iterate through the characters list and create an associative array of the characters and their count
foreach($characters as $char) {
$count[$char] = substr_count($string, $char);
View main.php
$string = "floccinaucinihilipilification";
$characters = array_unique(str_split($string));
$count = [];
foreach($characters as $char) {
$count[$char] = substr_count($string, $char);
}
// Order the array
You can’t perform that action at this time.