Skip to content

Instantly share code, notes, and snippets.

View nathan-isaac's full-sized avatar

Nathan Isaac nathan-isaac

View GitHub Profile
@danawoodman
danawoodman / Using Golang templ with the Echo framework.md
Last active April 22, 2024 10:23
Using Golang templ with the Echo framework

Using Golang templ with the Echo framework

templ is a great view framework but there is no clear documentation (as of writing) showing how to use it with the Echo web framework. This short guide should show you how to set it up:

Install dependencies

Install templ and echo:

go get github.com/a-h/templ

Converting Tailwind UI Alpine transitions to Vue transitions

After you copy a component from the Tailwind UI library and begin to adapt it from Vue JS to Alpine JS .. you may wonder what to do about the transitions. As I'm exploring this myself, I am documenting it for others in the same boat.

Things to be aware of:

  • Alpine calls the beginning and ending states "start" & "end"
  • Vue calls the beginning and ending states "from" and "to"
  • Alpine has inline "directives" ie x-transition:enter="classes"
  • Vue has a wrapper component that applies classes to the child
  • Alpine applies the classes you pass it for each state, :enter-start="class"
@kevincoleman
kevincoleman / Considerations.md
Last active November 26, 2019 18:18
Things to consider when writing features.

Considerations when writing code features

  • code complexity
  • overall amount of work
  • speed/time to production
  • code obfuscation vs simple readability
    • developer skill threshold for comprehension?
  • extensibility
    • modularity for reuse
  • separation of concerns
@brandonferens
brandonferens / MobileApplication.php
Created March 6, 2017 22:10
Trait for testing mobile devices in Dusk
<?php
namespace Tests;
use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\RemoteWebDriver;
trait MobileApplication
{
/**
@taylorotwell
taylorotwell / weather.sh
Last active August 27, 2019 13:40
Weather CLI
alias weather='curl -s wttr.in | sed -n "1,7p"'
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@taylorotwell
taylorotwell / global-homestead.sh
Created September 23, 2015 21:40
Global Homestead Without Composer
alias homestead='function __homestead() { (cd ~/Documents/Code/Homestead && vagrant $*); unset -f __homestead; }; __homestead'
# Usage
homestead up
homestead halt
# etc...
/**
* Destroy the user's session (logout).
*
* @return Response
*/
public function destroy()
{
Auth::logout();
flash()->info('You are now logged out.');
@fenos
fenos / FilterableInterface.php
Last active October 15, 2018 20:04
Custom Implementation of an Abstract RESTfull Repositories with Laravel.
<?php
interface FilterableInterface {
}
@laracasts
laracasts / Gulpfile.js
Created August 20, 2014 20:47
PHPSpec auto-testing Gulpfile
var gulp = require('gulp');
var phpspec = require('gulp-phpspec');
var run = require('gulp-run');
var notify = require('gulp-notify');
gulp.task('test', function() {
gulp.src('spec/**/*.php')
.pipe(run('clear'))
.pipe(phpspec('', { notify: true }))
.on('error', notify.onError({