Skip to content

Instantly share code, notes, and snippets.

@assoft
assoft / logging.php
Created November 7, 2024 00:06 — forked from SohanChy/logging.php
Configuring Laravel for JSON Logging Using Monolog (For Kibana)
...
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
],
'single' => [
'driver' => 'monolog',
'path' => storage_path('logs/laravel.log'),
@assoft
assoft / defaults.sh
Created February 24, 2023 17:58 — forked from andrewpetrochenkov/launchd.sh
macOS security
#!/usr/bin/env bash
# Disable Face Detect in Photos app
defaults write com.apple.iPhoto PKFaceDetectionEnabled 0
defaults write com.apple.gamed Disabled -bool true
defaults write com.apple.NetworkBrowser DisableAirDrop -bool YES # log out, log in
@assoft
assoft / auth.js
Created June 30, 2022 01:56 — forked from Stiropor/auth.js
Nuxt3 auth demo
import { nextTick } from 'vue'
export const useProperCookie = () => useCookie('proper_token')
export const useAuthFetch = (url, fetchOptions = {}) => {
return $fetch(url, {
baseURL: 'https://l9.test/api/v1',
...fetchOptions,
headers: {
Authorization: `Bearer ${useProperCookie().value}`,
...fetchOptions.headers,
@assoft
assoft / vimeo-downloader.js
Created July 8, 2021 18:12 — forked from aik099/vimeo-downloader.js
Download video from Vimeo (chopped m4s files)
// 1. Open the browser developper console on the network tab
// 2. Start the video
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL
// 4. Run: node vimeo-downloader.js "<URL>"
// (done automatically now) 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');
const { exec } = require('child_process');
@assoft
assoft / selenium-youtube.rb
Created December 28, 2020 02:32 — forked from mqu/selenium-youtube.rb
selenium and youtube player
#!/usr/bin/ruby
require "selenium-webdriver"
require 'pp'
# install :
# sudo apt-get install ruby ruby-dev chromium-chromedriver firefoxdriver
# sudo gem install selenium-webdriver
# sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/
@assoft
assoft / DocumentContentExtractor.php
Created August 10, 2020 04:41 — forked from lubobill1990/DocumentContentExtractor.php
Extract content from docx, doc and rtf
<?php
/**
* Created by IntelliJ IDEA.
* User: bill
* Date: 2018/11/06
* Time: 13:24
*/
use InvalidArgumentException;
@assoft
assoft / RouteDirectives.php
Created January 4, 2020 13:10 — forked from calebporzio/RouteDirectives.php
Blade Route Directives
<?php
// Register these inside a service provider:
Blade::directive('route', function ($expression) {
return "<?php echo route({$expression}) ?>";
});
Blade::directive('routeIs', function ($expression) {
return "<?php if (request()->routeIs({$expression})) : ?>";
@assoft
assoft / 01.md
Created July 23, 2019 18:24 — forked from nasrulhazim/01.md
Laravel Default API Login

Setup

Migration

Create new migration script:

php artisan make:migration add_api_token --table=users
@assoft
assoft / install_zsh.sh
Created April 16, 2017 03:06
ZSH Vagrant
#!/bin/bash
homestead up
homestead ssh
apt-get update
#Additional Packages
apt-get install -y zsh
@assoft
assoft / troubleshooting.md
Created February 5, 2017 00:59 — forked from adamwathan/troubleshooting.md
Troubleshooting Valet on macOS Sierra

Troubleshooting Valet on Sierra

Common Problems

Problem: I just see "It works!"

Apache is running on port 80 and interfering with Valet.

  1. Stop Apache: sudo /usr/sbin/apachectl stop
  2. Restart Valet: valet restart