Skip to content

Instantly share code, notes, and snippets.

View fosron's full-sized avatar
💻
Hard at work

Tautvydas fosron

💻
Hard at work
View GitHub Profile
@fosron
fosron / .php_cs.laravel.php
Created April 14, 2020 09:34 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null]
@fosron
fosron / GPG and git on macOS.md
Created December 10, 2019 14:47 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@fosron
fosron / SupervisordInstallationUbuntu12.04LTS.md
Last active February 9, 2018 16:13 — forked from alexhayes/SupervisordInstallationUbuntu12.04LTS.md
Supervisord Installation on Ubuntu 12.04 LTS

Supervisord Installation on Ubutnu 12.04 LTS

There are a number of solutions for installing supervisord and automatically running it on Ubuntu - this is what worked for me (on multiple installations...).

Installation

Quick & Easy

sudo bash &lt; &lt;(curl https://gist.githubusercontent.com/fosron/6a71c4dbb20eed463d764aa4c5799b22/raw/full-install.sh)
@fosron
fosron / SupervisordInstallationUbuntu12.04LTS.md
Created February 9, 2018 16:09 — forked from alexhayes/SupervisordInstallationUbuntu12.04LTS.md
Supervisord Installation on Ubuntu 12.04 LTS

Supervisord Installation on Ubutnu 12.04 LTS

There are a number of solutions for installing supervisord and automatically running it on Ubuntu - this is what worked for me (on multiple installations...).

Installation

Quick & Easy

sudo bash &lt; &lt;(curl https://gist.githubusercontent.com/alexhayes/814fd0d0f7020e918a95/raw/full-install.sh)
@fosron
fosron / CronRunCommand.php
Created December 15, 2016 15:46 — forked from sisou/CronRunCommand.php
Cron job command for Laravel 4.2
<?php
# Cron job command for Laravel 4.2
# Inspired by Laravel 5's new upcoming scheduler (https://laravel-news.com/2014/11/laravel-5-scheduler)
#
# Author: Soren Schwert (GitHub: sisou)
#
# Requirements:
# =============
# PHP 5.4
@fosron
fosron / colors.md
Created September 6, 2016 06:31 — forked from 0x263b/colors.md
Random color from string in javascript

Random color from string in javascript

Consider a list of strings you need to permanently assign a random color.

First you should turn the string into a hash.

var string = "string"
var hash = 0
@fosron
fosron / promises-reading-list.md
Created February 25, 2016 15:48 — forked from joepie91/promises-reading-list.md
Promises (Bluebird) reading list

Promises reading list

This is a list of examples and articles, in roughly the order you should follow them, to show and explain how promises work and why you should use them. I'll probably add more things to this list over time.

This list primarily focuses on Bluebird, but the basic functionality should also work in ES6 Promises, and some examples are included on how to replicate Bluebird functionality with ES6 promises. You should still use Bluebird where possible, though - they are faster, less error-prone, and have more utilities.

I'm available for tutoring and code review :)

You may reuse all gists for any purpose under the WTFPL / CC0 (whichever you prefer).

@fosron
fosron / lumen-resource-route.php
Created February 18, 2016 15:27 — forked from sohelamin/lumen-resource-route.php
Lumen Resource Routing
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
@fosron
fosron / osx_install.sh
Last active August 29, 2015 14:17 — forked from t-io/osx_install.sh
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
#!/bin/bash
# Install script for Latest WordPress by Johnathan Williamson - extended by Don Gilbert
# Disclaimer: It might not bloody work
# Disclaimer 2: I'm not responsible for any screwups ... :)
# DB Variables
echo "MySQL Host:"
read mysqlhost
export mysqlhost