Skip to content

Instantly share code, notes, and snippets.

View nicoverbruggen's full-sized avatar

Nico Verbruggen nicoverbruggen

View GitHub Profile
@nicoverbruggen
nicoverbruggen / CDVCommandQueue.m
Last active August 29, 2015 13:57
Cordova iOS 7.0/7.1 optimizations. Also fixes for 7.1 arm64 crashes in plugins in CordovaLib < 3.5. Also includes fix for no splash screen on iPhone with 3.5" screen.
// Fix for BAD_ACCESS on arm64 devices
// Per this diff: https://git-wip-us.apache.org/repos/asf?p=cordova-ios.git;a=blobdiff;f=CordovaLib/Classes/CDVCommandQueue.m;h=1eddfe37ee699289701cd4caaf68486607010501;hp=902dfa0227f1358296d2218fa0e6d5cc2a882ea6;hb=82ce4f2;hpb=7da5f2df3417de68a1b540bc00c11a95ce3dc7d6
// Should be fixed in CordovaLib 3.5
SEL normalSelector = NSSelectorFromString(methodName);
if ([obj respondsToSelector:normalSelector]) {
// [obj performSelector:normalSelector withObject:command];
((void (*)(id, SEL, id))objc_msgSend)(obj, normalSelector, command); // replace the old line with this one
} else {
// There's no method to call, so throw an error.
@nicoverbruggen
nicoverbruggen / main.css
Created March 12, 2014 12:35
Features you can use in CSS for Cordova builds (webkit)
/* The following optimizations can make your app feel more native. */
.element{
/* Disable selection/copy of UIWebView.
If you tap and hold, you can usually copy content fron a webview.
-webkit-user-select: none disables this functionality for a specific element. */
-webkit-user-select: none;
/* Disable the iOS popup when long-press on a link. (a-element, button, etc)
@nicoverbruggen
nicoverbruggen / Tips.md
Created March 16, 2014 12:50
Cordova Android optimizations

Hello

Just like my other gist, I'll add all kinds of tweaks and fixes for Cordova android builds here.

Android platform optimizations and customization

Icons

Place your icons in the /platforms/android/res/drawable* folders. (As icon.png.) Remember to respect DPI rules.

@nicoverbruggen
nicoverbruggen / commit-msg
Created February 18, 2015 14:15
Git hook that checks if you reference an issue in your commit
#!/usr/bin/env ruby
message_file = ARGV[0]
message = File.read(message_file)
$regex = /#(\d+)/
if !$regex.match(message)
puts "[POLICY] Please reference an issue in your commit."
exit 1
end
@nicoverbruggen
nicoverbruggen / guide.md
Last active June 2, 2019 10:13
Handy repositories for managing a clean Windows 10 installation

Windows 10 Clean Installation Procedure

Post-Installation

  • Run the Windows 10 debloater script.
    • Download the latest version's zip.
    • Right-click on "Windows10DebloaterGUI.ps1"
    • Select "Run with Powershell"
    • Follow the instructions as provided in the repository to complete the cleanup
@nicoverbruggen
nicoverbruggen / .my.cnf
Last active April 18, 2020 19:37
Dump database file
[mysqldump]
user=root
password=INSERT_PASSPHRASE_HERE
@nicoverbruggen
nicoverbruggen / composer-swap.sh
Last active November 22, 2021 16:38
Easily swap in dependencies linked in a directory (./packages); filled in with examples I use
#!/bin/sh
# This script swaps out a production version of the packages with a local development version (or back).
echo "Removing vendor/nicoverbruggen/atlas-core..."
rm -rf ./vendor/nicoverbruggen/atlas-core
echo "Removing vendor/nicoverbruggen/gatekeeper..."
rm -rf ./vendor/nicoverbruggen/gatekeeper
# We’ll create a backup file that we can simply restore when we have to roll back the dependencies to a production version.
FILE=./composer.json.bak
@nicoverbruggen
nicoverbruggen / commands.sql
Last active March 27, 2022 22:34
WSL 2.x and MySQL Server
# Allow access to SQL
UPDATE mysql.user SET plugin='mysql_native_password' WHERE User='root'
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'
# You should now have access via: `mysql -u root -p` using the password `root`
# Allow access via any host
CREATE USER 'root'@'%' IDENTIFIED BY 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
@nicoverbruggen
nicoverbruggen / upgrade.sh
Created April 4, 2022 07:55
Homebrew upgrade PHP
!/bin/sh
# If you are getting issues w/ broken dependents: try `brew reinstall apr-util`
# Alternatively, check linkage here: `brew linkage php`
# Disable Valet
valet stop
# Upgrade PHP
# brew update && brew upgrade php php@8.0 php@7.4
@nicoverbruggen
nicoverbruggen / RetrieveGitHubData.php
Created May 31, 2022 21:15
How to retrieve GitHub stargazer and downloads data via a Command
<?php declare(strict_types=1);
namespace App\Console\Commands;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Illuminate\Console\Command;