Skip to content

Instantly share code, notes, and snippets.

@sfcgeorge
sfcgeorge / packed-pixels-switchresx.md
Created December 9, 2015 16:13
Packed Pixels HiDPI Retina using SwitchResX

On OS X the Packed Pixels display won't automatically show up as "Retina" or "HiDPI" resolution, instead the OS will use the full resolution of the display making everything tiny. This can be changed using the 3rd party app (non-free) SwitchResX.

First, download SwitchResX.

You can play with the resolutions for the Packed Pixels which is probably listed as Color LCD (2). However not all of the HiDPI resolutions work due to an OS X bug. If you are happy with any of the ones that do work then stop here, else continue.

If you're on El Capitan or later you need to disable System Integrity Protection (temporarily) to add a custom resolution for Packed Pixels. Follow the instructions from SwitchResX creator.

Now add a Custom Resolution that is "scaled". It must be 2 pixels bigger or smaller than the native resolution in one direction (this is the OS X quirk). I found bigger makes it slightly blurry so go w

@zaiddabaeen
zaiddabaeen / exportMySQLUsersPDO.php
Created February 23, 2016 11:47
Exports MySQL Users and Privileges using PDO
* Feel free to improve it.
* Original by Janich: https://gist.github.com/janich/6121771
*
* @requires PHP 5.3+
* @package ExportMySQLUsers
* @author Zaid Daba'een
* @license http://www.dbad-license.org/ DBAD license
*/
// Set up database root credentials
$host = 'localhost';
@petericebear
petericebear / .php_cs
Last active June 26, 2023 02:32
Laravel 5.x php-cs-fixer config file
<?php
$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/cache')
->notPath('storage')
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
@escapedcat
escapedcat / README.md
Last active December 17, 2022 07:42
Tutorial: Cordova iOS build with fastlane, match and Jenkins

Cordova CI with Jenkins for iOS apps

Inspired by CI server on Mac OS for iOS using GitLab and Fastlane by @v_shevchyk we decided to write down our approach. This will be extended and improved over time.

So you want to deploy your Cordova app, but you hate opening xcode manually to archive and export and sign and cry? Try this. By this we mean we try to explain how to create the following CI (Jenkins) setup:

  • Build Cordova app
  • Create & sign your ipa file
  • Upload to HockeyApp (for Enterprise distribution)
@spartanatreyu
spartanatreyu / init.lua
Last active May 27, 2024 06:23
Personal Window Management script (hammerspoon)
--Hammerspoon config to replace Cinch & Size-up (Microsoft Windows style) window management for free
--Windows Vista/7's Areo Snap on MacOS
--By Jayden Pearse (spartanatreyu)
-------------------------------------------------------------------
--Options, feel free to edit these:
-------------------------------------------------------------------
--Set this to true to snap windows by dragging them to the edge of your screen
enable_window_snapping_with_mouse = true
@idecardo
idecardo / homestead-manual-install.md
Last active November 16, 2023 08:34
Laravel Homestead Manual Installation

Getting Started

Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine. Read more...

Download

Download homestead box:

https://streamacon.com/video/laracon-us/taylor-otwell-laravel-53-overview
https://streamacon.com/video/laracon-us/adam-wathan-test-driven-laravel
https://streamacon.com/video/laracon-us/chris-fidao-servers-for-hackers.
https://streamacon.com/video/laracon-us/evan-you-vuejs-workshop
https://streamacon.com/video/laracon-us/evan-you-vue-router-and-vuex
https://streamacon.com/video/laracon-us/jack-mcdade-wizards-lawnmowers-and-hovercrafts
https://streamacon.com/video/laracon-us/sentry-product-demo
https://streamacon.com/video/laracon-us/ben-ramsey-long-live-http2
https://streamacon.com/video/laracon-us/zeev-suraski-php-7
https://streamacon.com/video/laracon-us/amanda-folson-apis-with-lumen
@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active June 3, 2024 05:57
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@kuznero
kuznero / vdi-file-compacting.md
Last active March 22, 2024 22:49
How to compact VirtualBox's VDI file size?

Source: StackOverflow

1. Run defrag in the guest (Windows only)

2. Nullify free space:

With a Linux Guest run this:

sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile
@gilbitron
gilbitron / InvoicePaid.php
Created November 14, 2016 12:31
Convert the Laravel Spark invoice email to a notification email
<?php // app/Notifications/InvoicePaid.php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Laravel\Cashier\Invoice;