Skip to content

Instantly share code, notes, and snippets.

@theCrius
theCrius / Dockerfile
Created March 19, 2021 15:21 — forked from Machy8/Dockerfile
PHP-FPM 7.1 with Unix Sockets + Nginx in Docker
FROM debian:stretch
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
wget \
zip \
git \
unzip && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
@theCrius
theCrius / ngb-date-uk-parser-formatter.ts
Created September 26, 2019 10:47
Ngb-UK-Parser-Formatter.ts
import { Injectable } from '@angular/core';
import { NgbDateParserFormatter, NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
@Injectable()
export class NgbDateUKParserFormatter extends NgbDateParserFormatter {
parse(value: string): NgbDateStruct {
if (value) {
const dateParts = value.trim().split('/');
if (dateParts.length === 1 && isNumber(dateParts[0])) {
return {year: toInteger(dateParts[0]), month: null, day: null};
@theCrius
theCrius / ngb-momentjs-adapter.ts
Last active September 26, 2019 10:45 — forked from jeroenheijmans/ngb-momentjs-adapter.ts
NgbDateAdapter for Moment.js values
import { NgbDateAdapter, NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
import { Injectable } from '@angular/core';
import * as moment from 'moment';
// Might need to polyfill depending on needed browser support...
const isInt = Number.isInteger;
@Injectable()
export class NgbMomentjsAdapter extends NgbDateAdapter<moment.Moment> {
@theCrius
theCrius / script.js
Last active June 3, 2018 14:25
ViolentMonkey Script to add QoL feature on ~tilde.net alpha
// ==UserScript==
// @name Tildes Aplha Extended
// @namespace https://tildes.net/
// @version 0.1
// @description Simple QoL improvements while they are developed in the source code
// @author Tildes Users
// @match https://tildes.net/*
// @require https://code.jquery.com/jquery-3.3.1.min.js
// @grant GM_addStyle
// ==/UserScript==
@theCrius
theCrius / sass-spacing-helper.scss
Last active January 26, 2018 11:43
Simple helper in sass to manage fine-tuning of that goddamn html
/* usage example */
/* <div class="mt-5"></div> --> Set div with margin-top: 5px */
/* <div class="m-5"></div> --> Set div with margin: 5px */
/* <div class="my-5"></div> --> Set div with margin-top: 5px, margin-bottom: 5px */
/* Spacing Helpers */
$spaces: (1, 2, 3, 4, 5, 10, 15, 20, 25, 30);
$sides: ('t', 'b', 'l', 'r', 'x', 'y', '');
@each $space in $spaces {
@theCrius
theCrius / ping-timestamp.bat
Created December 21, 2017 10:54
Windows .bat file to run and log to file a ping to any host while adding timestamp
@echo off
set /p host=host Address:
set logfile=Log_%host%.log
echo Target Host = %host% >%logfile%
for /f "tokens=*" %%A in ('ping %host% -n 1 ') do (echo %%A>>%logfile% && GOTO Ping)
:Ping
for /f "tokens=* skip=2" %%A in ('ping %host% -n 1 ') do (
echo %date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%A>>%logfile%