Skip to content

Instantly share code, notes, and snippets.

@lattespirit
lattespirit / composer.json
Created June 2, 2020 10:57
Download unsplash images PHP script
{
"require": {
"kitetail/zttp": "^0.6.0"
}
}
@lattespirit
lattespirit / .prettierrc
Created March 16, 2020 03:27
.prettierrc file
{
"trailingComma": "es5",
"tabWidth": 2,
"vueIndentScriptAndStyle": true
}
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
@lattespirit
lattespirit / tailwind.sublime-completions
Created November 13, 2019 10:29
TailwindCSS auto completions for Sublime
{
"scope": "source.*",
"completions": [
{ "trigger": "container", "contents": "container" },
{ "trigger": "sr-only", "contents": "sr-only" },
{ "trigger": "not-sr-only", "contents": "not-sr-only" },
{ "trigger": "focus:sr-only", "contents": "focus:sr-only" },
{ "trigger": "focus:not-sr-only", "contents": "focus:not-sr-only" },
{ "trigger": "appearance-none", "contents": "appearance-none" },
{ "trigger": "bg-fixed", "contents": "bg-fixed" },
@lattespirit
lattespirit / main.js
Last active November 6, 2019 12:57
Setting up TailwindCSS and Vue.js
import Vue from 'vue';
const files = require.context('./', true, /\.vue$/i)
files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
new Vue({
el: "#app",
})
@lattespirit
lattespirit / DatabaseSeeder.php
Last active May 15, 2020 07:13
Quickly create millions records with Laravel Seeder
<?php
use App\User;
use Faker\Factory;
use Illuminate\Support\Str;
use Illuminate\Database\Seeder;
use Illuminate\Support\LazyCollection;
class DatabaseSeeder extends Seeder
{
@lattespirit
lattespirit / steps.log
Created December 14, 2018 15:54
Create Self Signed SSL Certificates
sudo openssl genrsa -out "/etc/ssl/your-domain-name.key" 2048
# Generate a CSR using the private key for encryption
sudo openssl req -new -key "/etc/ssl/your-domain-name.key" -out "/etc/ssl/your-domain-name.csr"
sudo openssl x509 -req -days 365 \
-in "/etc/ssl/your-domain-name.csr" \
-signkey "/etc/ssl/your-domain-name.key" \
-out "/etc/ssl/your-domain-name.crt"
@lattespirit
lattespirit / Envoy.blade.php
Last active September 30, 2017 08:54
Envoy config file to deoply Laravel 5.5 Project
@servers(['web' => 'me'])
@setup
$date = date('YmdHis');
$repo = '[email protected]:username/repo.git';
$app_dir = 'your/host/path';
$releases = '/var/www/releases';
@lattespirit
lattespirit / .php_cs
Last active April 1, 2019 04:21
PHP Code Style Fixer config file
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('somedir')
->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php')
->in(__DIR__)
;
return PhpCsFixer\Config::create()
->setUsingCache(false)
@lattespirit
lattespirit / WebhookController.php
Created July 25, 2017 06:09
Handle Github Webhook using PHP(Laravel/Lumen Framework)
<?php
namespace App\Http\Controllers;
use Log;
use Illuminate\Http\Request;
use Symfony\Component\Process\Process;
use Laravel\Lumen\Routing\Controller as BaseController;
class WebhookController extends BaseController