Skip to content

Instantly share code, notes, and snippets.

@crzapata
crzapata / gist:43f5d7da85a4df23aa09eff5d04d935c
Created January 22, 2023 14:05
Workaround for TailwindCSS styles not downloading in Laravel 9
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
server: {
hmr: {
host: 'localhost'
}
},
plugins: [
<script type="text/javascript">
// Detect IE10 or below
if(document.all) {
$result = window.confirm('The browser you are using is not compatible with this site. Please update your browser. Press \'ok\' to view browser download options.');
if ($result){
window.location.href = "http://outdatedbrowser.com/en";
}
}
</script>
@crzapata
crzapata / gist:892ad20c0b895275216be5a84ea427d2
Created September 17, 2018 15:37
Swapfile for Vagrant Ubuntu
vagrant ssh
sudo su
rm /swapfile
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon -s
Source: https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04
@crzapata
crzapata / gist:6e2b05d1522dcae062ba6beb360bdf1f
Last active September 23, 2016 16:22
Install and manage multiple php versions and extensions with homebrew
#install php and all desired extensions for that php version
brew install php55 php55-intl php55-mcrypt php55-apcu php55-xdebug
brew unlink php55
#repeat as needed
brew install php56 php56-intl php56-mcrypt php56-apcu php56-xdebug
brew unlink php55
#install brew-php-switcher
brew install brew-php-switcher
#use brew-php-switcher to switch between versions
brew-php-switcher 55 -s
@crzapata
crzapata / gist:7295b5c853d21563f6c27780b17affb9
Created September 7, 2016 13:41
List cron jobs for all users
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
@crzapata
crzapata / gist:8f991f11565dd892cfed
Created January 13, 2016 14:25
Search for CRON or other info in syslog files
zgrep -i search_term /var/log/syslog*
@crzapata
crzapata / gist:3ebb9b5510c2df03e1a5
Last active August 29, 2015 14:11
openssl key and csr generation
openssl genrsa 2048 > my-key.pem
openssl req -sha256 -new -key my-key.pem -out my-key-csr.pem
@crzapata
crzapata / gist:6a036d7355a28836e5ed
Created November 29, 2014 23:55
Permission settings fix for using vagrant when user home directory is located in external/secondary drive (Mac OS X)
sudo chown -R YOUR_USER_NAME:staff /Volumes/YOUR_EXT_VOLUME_NAME/Users/YOUR_USER_NAME/.vagrant.d/
@crzapata
crzapata / PR_Municipios
Created August 24, 2012 17:18
Puerto Rico Municipalities CSV
name
Adjuntas
Aguada
Aguadilla
Aguas Buenas
Aibonito
Anasco
Arecibo
Arroyo
Barceloneta
@crzapata
crzapata / MAMP Silex htaccess
Created August 18, 2012 21:49
htaccess definition for silex when using MAMP
<IfModule mod_rewrite.c>
RewriteEngine on
#uncomment next line if silex app root is in a mamp subdirectory
#RewriteBase /your_mamp_htdocs_silex_app_root
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ web/index.php [L]
</IfModule>
define your silex routes as follows:
$app->get('/your_mamp_htdocs_silex_app_root/', function() {