Skip to content

Instantly share code, notes, and snippets.

View joshghent's full-sized avatar
🤡
🔫

Josh Ghent joshghent

🤡
🔫
View GitHub Profile
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('resources', '0004_editablemodel'),
// Place your settings in this file to overwrite the default settings
{
"editor.tabSize": 2,
"files.autoSave": "onFocusChange",
"php.validate.run": "onType",
"vsicons.dontShowNewVersionMessage": true,
"workbench.colorTheme": "Monokai",
"workbench.colorCustomizations": {
"activityBar.foreground": "#66d9efbf"
},
@joshghent
joshghent / cloudSettings
Last active December 13, 2020 15:30
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-12-13T15:29:59.665Z","extensionVersion":"v3.4.3"}
@joshghent
joshghent / .htaccess
Created March 26, 2018 21:24
Cache Control Headers for Apache
# Cache Images for 1 Year
<filesMatch ".(jpg|jpeg|png|gif|ico)$">
Header set Cache-Control "max-age=31536000, public"
</filesMatch>
# But Cache JS and CSS for a month!
<filesMatch ".(css|js)$">
Header set Cache-Control "max-age=2628000, public"
</filesMatch>
@joshghent
joshghent / Meetup Checklist.csv
Created December 22, 2018 12:00
Checklist for running a meetup
TYPE CONTENT PRIORITY INDENT AUTHOR RESPONSIBLE DATE DATE_LANG TIMEZONE
task Month Before: 1 1 Josh (17592616) Josh (17592616) en Europe/London
task Confirm speakers for date 4 2 Josh (17592616) Josh (17592616) every 3rd thursday en Europe/London
task Get speaker twitter handles 4 2 Josh (17592616) Josh (17592616) every 3rd thursday en Europe/London
task Invite speakers to LeicesterJS slack 4 2 Josh (17592616) Josh (17592616) every 3rd thursday en Europe/London
task Get talk titles from speakers 4 2 Josh (17592616) Josh (17592616) every 3rd thursday en Europe/London
@joshghent
joshghent / main.php
Created February 10, 2019 22:54
ElatedCuddlyMachinecode created by joshghent - https://repl.it/@joshghent/ElatedCuddlyMachinecode
class TestClass {
const aVariable = 'test';
}
echo TestClass::aVariable;
@joshghent
joshghent / main.php
Created February 12, 2019 21:45
AgedFirsthandKeyboard created by joshghent - https://repl.it/@joshghent/AgedFirsthandKeyboard
$string = "floccinaucinihilipilification";
$characters = array_unique(str_split($string));
$count = [];
foreach($characters as $char) {
$count[$char] = substr_count($string, $char);
}
// Order the array
@joshghent
joshghent / main.php
Created February 12, 2019 21:46
AgedFirsthandKeyboard created by joshghent - https://repl.it/@joshghent/AgedFirsthandKeyboard
$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);
@joshghent
joshghent / graphite.ts
Last active March 5, 2019 17:59
Grafana
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;
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();