Skip to content

Instantly share code, notes, and snippets.

View tristanbailey's full-sized avatar
🏭
Talking to manufacturers

Tristan Bailey tristanbailey

🏭
Talking to manufacturers
View GitHub Profile
@ankurk91
ankurk91 / install-node-js.sh
Last active February 11, 2026 04:43
Install node-js, npm and yarn on Ubuntu/Mac using nvm
#!/bin/sh
# Install node and npm via nvm - https://github.com/nvm-sh/nvm
# Run this script like - bash script-name.sh
# Define versions
INSTALL_NODE_VER=24
INSTALL_NVM_VER=0.40.4
@rponte
rponte / get-latest-tag-on-git.sh
Last active February 2, 2026 14:38
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@joselfonseca
joselfonseca / CartService.php
Created September 8, 2015 15:17
Generate Order Command
<?php
namespace App\Services\Cart;
use App\Services\Cart\Commands\GenerateOrder;
use App\Services\Cart\Commands\GenerateOrderHandler;
class CartService {
private $bus;
@james2doyle
james2doyle / phplint-folder.sh
Last active July 14, 2021 06:30
Use PHP lint on a folder of PHP files
#!/usr/bin/env bash
# found on http://kamisama.me/2012/07/02/faster-php-lint/
find my/folder/ -name "*.php" -print0 | xargs -0 -n1 -P8 php -l
@phproberto
phproberto / sample.php
Created June 5, 2015 10:12
Joomla: Get available values for a fieldsattach multiple selector
<?php
$db = JFactory::getDbo();
// Get the available offices
$offices = array();
$officeFieldId = 5;
$query = $db->getQuery(true)
->select('field.extras')
->from('#__fieldsattach AS field')
@paulirish
paulirish / readme.md
Last active April 2, 2024 20:18
resolving the proper location and line number through a console.log wrapper

console.log wrap resolving for your wrapped console logs

I've heard this before:

What I really get frustrated by is that I cannot wrap console.* and preserve line numbers

We enabled this in Chrome DevTools via blackboxing a bit ago.

If you blackbox the script file the contains the console log wrapper, the script location shown in the console will be corrected to the original source file and line number. Click, and the full source is looking longingly into your eyes.

@drmmr763
drmmr763 / default
Last active June 15, 2018 11:35
mautic-symfony-nginx
server {
listen 80;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name _;
location / {
@jdubwelch
jdubwelch / ctags
Created November 17, 2014 19:55
Ctags command for php project
ctags -R -f .tags --regex-php='/^[ \t]*trait[ \t]+([a-z0_9_]+)/\1/t,traits/i' --regex-php='/abstract class ([^ ]*)/\1/c/' --regex-php='/interface ([^ ]*)/\1/c/' --regex-php='/(public |static |abstract |protected |private )+ function +([^ \(]*)/\2/f/' --exclude=.git --exclude=.svn --exclude=node_modules
@jdubwelch
jdubwelch / BaseModel.php
Last active February 3, 2016 00:53
Multiple Database on Different Servers Laravel Solution
<?php
use Eloquent;
class BaseModel extends Eloquent {
/**
* The default connection
*/
protected $connection = 'db1-mysql';