Skip to content

Instantly share code, notes, and snippets.

View Oranzh's full-sized avatar
🏠
Working from home

Lix Oranzh

🏠
Working from home
  • Xi'an China
  • 21:21 (UTC -12:00)
View GitHub Profile
@pookjw
pookjw / seedutil.md
Last active July 6, 2023 02:47
Enroll macOS Beta Seed without profile installation

seedutil

Enroll macOS Beta Seed without profile installation

Usage

$ sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil 
usage: seedutil enroll SEED_PROGRAM
    seedutil unenroll

seedutil current

@robertripoll
robertripoll / BarcodeGeneratorPNG.php
Created July 12, 2017 10:01
Barcode generator in PNG format with text in the bottom
public function getBarcode($code, $type, $widthFactor = 2, $totalHeight = 30, $color = array(0, 0, 0))
{
$barcodeData = $this->getBarcodeData($code, $type);
// calculate image size
$width = ($barcodeData['maxWidth'] * $widthFactor);
$height = $totalHeight;
if (function_exists('imagecreate')) {
// GD library
@joseluisq
joseluisq / 1README.md
Last active January 3, 2022 13:22
Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.

Lumen 5 HTTP Exception Handlers with JSON support.

Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.

image

Setup

Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php and app/Http/Middleware/Authenticate.php

@noelboss
noelboss / git-deployment.md
Last active July 16, 2024 09:50
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@joseluisq
joseluisq / mysql_helpful_commands.md
Last active September 30, 2019 10:01
Some useful commands and scripts for MySQL.

MySQL helpful commands and scripts

Some useful commands and scripts for MySQL.

Update: All these commands and more at https://github.com/joseluisq/awesome-mysql-queries-commands

Import script file from console

mysql -h host -u username -p password --default_character_set utf8 database_name < mysql_script.sql
@natefoo
natefoo / galaxy.conf
Created July 5, 2015 13:03
supervisor examples
[program:galaxy_test_uwsgi]
command = /usr/bin/sg G-803372 '/srv/galaxy/test/venv/bin/uwsgi --ini /srv/galaxy/test/config/uwsgi.ini'
directory = /srv/galaxy/test/server
umask = 022
autostart = true
autorestart = true
startsecs = 15
user = g2test
environment = PYTHON_EGG_CACHE=/srv/galaxy/test/var/python-egg-cache-test_uwsgi,GALAXY_EGGS_PATH=/srv/galaxy/test/eggs
numprocs = 1
@idleberg
idleberg / Install-Mcrypt.md
Last active May 31, 2023 17:13
Install Mcrypt on macOS

Setup php-mcrypt on macOS (and versions of Mac OS X)

These steps should have been mentioned in the prerequisites of the Laravel Installation Guide, since I'm surely not the only person trying to get Laravel running on macOS.

Install

Install Mcrypt using Homebrew and PECL (comes with PHP)

# PHP 7.3
@esfand
esfand / nginx1subapp.md
Last active June 3, 2023 01:15
Nginx Location Ruels

Serving multiple webapps from different folders

November 29, 2011 developmentNginx

Few days ago I had to add a wordpress installation within the same environment where a Codeigniter app was already running happily and undisturbed.

It took me a while to figure out how to keep separate folders on the filesystem, and serve the blog from a subfolder of the main domain:

@ogrrd
ogrrd / dnsmasq OS X.md
Last active July 22, 2024 08:36
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active July 4, 2024 17:31
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1