Skip to content

Instantly share code, notes, and snippets.

View alexwoollam's full-sized avatar
:octocat:

Alexander King Woollam alexwoollam

:octocat:
View GitHub Profile
@alexwoollam
alexwoollam / txt
Created February 17, 2022 05:58
Elastic search cheatsheet
//
//sudo /etc/init.d/elasticsearch start
// Start
sudo systemctl start elasticsearch.service
// Check
curl 127.0.0.1:9200
// Get some stuff
wget http://127.0.0.1:9200/_stats?format=json
@alexwoollam
alexwoollam / dotnet
Last active April 14, 2021 09:17
dotnet cheatsheet
//while in the dir
dotnet new sln
dotnet new webapi -o Project.Api
dotnet new classlib -o Project.Module
//add to solution:
dotnet sln add Project.Api/Project.Api.csproj Project.Core/Project.Core.csproj Project.Data/Project.Data.csproj etc...
//link them:
@alexwoollam
alexwoollam / gist:ac2bd7fd5ac255b512746df6bb240e8f
Created November 5, 2020 10:46
Regex, snake_case to camelCase
search: (\$)(\w+)_(\w)([\w-]*)
replace: $1$2\U$3$4
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew cask install google-chrome
brew cask install visual-studio-code
brew cask install docker
brew install git
brew install composer
brew install node
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
#!/bin/sh
pipeline {
agent any
stages {
stage('Checkout Repo') {
steps {
checkout scm
}
}
stage('Build') {
@alexwoollam
alexwoollam / style.scss
Last active September 19, 2019 14:24
Bootstrap responsive helper/
body{
// Dev tool, remove once done! //
@include media('xs') {
&::before{
content: "xs";
position: fixed;
top: 0px;
height: 20px;
width: 100%;
background-color: #D9B504;
@alexwoollam
alexwoollam / functions.php
Created March 6, 2019 21:54
It's possible to use namespaces by hooking onto the timber/loader/loader filter.
add_filter( 'timber/loader/loader', function( $loader ){
$loader->addPath( __DIR__ . "/views/components", "components" );
return $loader;
} );
// To use the namespace in your Twig template, just include it with an @ prefix.
{{ include( '@components/filename.twig' ) }}
@alexwoollam
alexwoollam / _mixins.scss
Last active January 30, 2019 11:22
Neat media query in sass
// Breakpoints (this map lives in variables).
$breakpoint:(
'xxsmall': 400px, // max-width
'xsmall': 400px, // min-width...
'small': 600px,
'medium': 1000px,
'large': 1200px,
'xlarge': 1400px,
'xxlarge': 1600px,
@alexwoollam
alexwoollam / functions.php
Last active September 30, 2018 17:32
Fixes Time.ly ai1ec GMT/BST issues, (events being a day behine in summer)
/**
* Get start and end of BST.
*/
$bst-month = date( 'Y/03/d', strtotime('last sunday of march' ) );
$gmt-month = date( 'Y/10/d', strtotime('last sunday of october' ) );
$event_date_sanitized = $datetime->format( 'Y/m/d' );
if ( $result->allday ){
if ( $event_date_sanitized >= $bst-month && $event_date_sanitized <= $gmt-month ){
$datetime->modify( '+1 day' );
@alexwoollam
alexwoollam / Jenkinsfile
Last active September 5, 2018 15:04
Jenkinsfile for wordpress wip
#!/bin/sh
pipeline {
agent any
stages {
stage('Checkout Repo') {
steps {
checkout scm
}
}
stage('Build') {