Skip to content

Instantly share code, notes, and snippets.

View admench's full-sized avatar
🔬
Testing

Adam Menczykowski admench

🔬
Testing
View GitHub Profile
@admench
admench / clear-db.sh
Created December 2, 2023 10:50
Database clear script - Remove database entirely, create new one and import from sql file, then run laravel migration and seed
## ===================================================================
## Database clear script
## Remove database entirely, create new one and import from sql file
## then run laravel migration and seed
## ===================================================================
# check if user passes two parameters
if [ $# -ne 3 ]; then
echo "Usage: $0 <db-name> <sql-file> <db-password>"
exit 1
fi
@admench
admench / find files that don't contain string.sh
Created November 14, 2022 09:35
Look through files recursively and find ones that don't contain a particular string
// Look through vue files recursively and find ones that don't have a component name set:
grep -r -L "name:" ./**/*.vue
@admench
admench / .zshrc
Last active August 8, 2022 12:16
My zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/adammenczykowski/.oh-my-zsh"
ZSH_THEME="bira"
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/

Estimation

This document is an attempt to pin down all the things you don't think about when quoting for a project, and hopefully provide a starting point for some kind of framework to make quoting, working and delivering small-medium jobs more predictable and less stressful.

Quoting

The hardest bit of any job, and lots of pitfalls

Estimating the work

  • the actual work of what you see on screen will only be a fraction of the work to do
@admench
admench / provider-pattern.vue
Last active August 25, 2021 09:34
A demonstration of the vue component provider pattern
<template>
<div v-for="card in results">
<card-provider :card="card">
<template v-slot="cardProps">
<card v-bind="cardProps" />
</template>
</card-provider>
</div>
</template>
<?php
use Illuminate\Database\Seeder;
use App\Models\LocalAuthority;
class LocalAuthoritiesSeeder extends Seeder
{
/**
* This is a database seeder for UK local authorities.
* The file is a laravel database seeder but the arrays could be used for anything.
@admench
admench / glide.js
Created September 19, 2018 19:58
Instantiate glide.js in Vue
<script>
const linkifyHtml = require("linkifyjs/html");
import Glide from "@glidejs/glide";
export default {
props: {
tweets: {}
},
data() {
return {
glide: null
@admench
admench / cache-static-resources.nginx
Created July 31, 2017 10:13
Forge Nginx cache settings
# cache.appcache, your document html and data
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
try_files $uri $uri/ /index.php?$args;
expires -1;
}
# Feed
location ~* \.(?:rss|atom)$ {
try_files $uri $uri/ /index.php?$args;
expires 1h;
@admench
admench / site-no-www
Last active September 13, 2015 14:50
Pre configured Nginx site for Laravel Forge provisioned servers with www redirect to non-www host to be used for Craft CMS based sites
server {
listen 80;
server_name www.domain;
return 301 $scheme://domain$request_uri;
}
server {
listen 80;
server_name domain;
root /home/forge/domain/public;
@admench
admench / site
Last active September 13, 2015 14:50
Pre configured Nginx site for Laravel Forge provisioned servers to be used for Craft CMS based sites
server {
listen 80;
server_name domain;
root /home/forge/domain/public;
# FORGE SSL (DO NOT REMOVE!)
# ssl on;
# ssl_certificate;
# ssl_certificate_key;