Skip to content

Instantly share code, notes, and snippets.

View tripflex's full-sized avatar
🦋
in the zone

Myles tripflex

🦋
in the zone
View GitHub Profile
@progrium
progrium / README.md
Last active August 20, 2024 22:33
Setting up M1 Macs for x86 development with Homebrew

Key Points

  • In general, binaries built just for x86 architecture will automatically be run in x86 mode
  • You can force apps in Rosetta 2 / x86 mode by right-clicking app, click Get Info, check "Open using Rosetta"
  • You can force command-line apps by prefixing with arch -x86_64, for example arch -x86_64 go
  • Running a shell in this mode means you don't have to prefix commands: arch -x86_64 zsh then go or whatever
  • Don't just immediately install Homebrew as usual. It should most likely be installed in x86 mode.

Homebrew

Not all toolchains and libraries properly support M1 arm64 chips just yet. Although

@nullvariable
nullvariable / cache-aggressive-license-checks.php
Last active January 24, 2023 11:59
Make annoying WordPress plugins that constantly perform license checks in the admin behave.
<?php
/**
* Plugin Name: Cache Aggressive License Checks
* Description: Cache the license checks for plugins that are lame and check on every request.
* Author: Doug Cone
* Author URI: http://dougcone.com
* Version: 0.0.1
*
*/
static void print_mgos_ro_vars(struct json_out *out, va_list *ap) {
struct mgos_ro_vars *p = va_arg(*ap, struct mgos_ro_vars *);
json_printf(out,
"{mac_address: %Q, arch: %Q, fw_version: %Q, fw_timestamp: %Q, "
"fw_id: %Q}",
p->mac_address, p->arch, p->fw_version, p->fw_timestamp,
p->fw_id);
}
static void main_timer_cb(void *arg) {
@mamuesp
mamuesp / mgos_draw_dif_zipped.c
Created July 28, 2018 17:09
Extend the Mongoose-OS lib ili9341-spi and allows to draw DIFs driectly from memory
bool mgos_draw_dif_zipped(uint16_t x, uint16_t y, const char * difName) {
struct mbuf *picRead = NULL;
struct mbuf *picCache = NULL;
char *bmpBuf = NULL;
char *dif_hdr = NULL;
char *dif_start = NULL;
size_t bufLen = 0;
size_t picLen = 0;
size_t difhLen = 16;
@mamuesp
mamuesp / tools.js
Last active June 1, 2018 12:34
Tool collection to use with mjs (Mongoose-OS JavaScript)
/**
Copyright 2018 M.Mueller-Spaeth <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@kevinwhoffman
kevinwhoffman / resources-web-developers-designers.md
Last active August 1, 2024 06:59
Resources for Web Developers and Designers

Resources for Web Developers and Designers

This is an incomplete list of resources including courses and individuals who publish content that has helped me grow as a web developer and designer. Many of these resources are WordPress-specific as that is my current area of specialization. This list will grow over time. If you've got something to add, send me a link @kevinwhoffman and I'll check it out!

Course Providers

@adammcfadden
adammcfadden / font-loader.vue
Last active June 26, 2021 10:18
Vue component for loading minimal fonts with webfontloader
// Vue component for loading minimal fonts with webfontloader
<template>
</template>
<script>
//https://github.com/typekit/webfontloader
import WebFontLoader from 'webfontloader';
export default {
@kuldipem
kuldipem / app-exit.js
Created July 12, 2016 19:36
Cordova/PhoneGap exit app after twice press back button with toast ( plugin required https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin )
var lastTimeBackPress=0;
var timePeriodToExit=2000;
function onBackKeyDown(e){
e.preventDefault();
e.stopPropagation();
if(new Date().getTime() - lastTimeBackPress < timePeriodToExit){
navigator.app.exitApp();
}else{
window.plugins.toast.showWithOptions(
@johnbillion
johnbillion / wp_mail.md
Last active June 3, 2024 13:31
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@mikejolley
mikejolley / gist:4b495f544bb632757e27
Last active May 12, 2022 12:14
Resume Manager Repeated Rows Example. Requires 1.11.4
/**
* Return an array of fields which will repeat (have multiple rows)
*
* Subfields should be named group_fieldname[]
*
* @return array
*/
function get_custom_repeated_field_fields() {
return array(
'field1' => array(