Skip to content

Instantly share code, notes, and snippets.

View davidpanzarella's full-sized avatar

David Panzarella davidpanzarella

View GitHub Profile
@getify
getify / 1.html
Last active October 20, 2024 20:10
Ever noticed how vw/vh units in CSS seem to be a bit unreliable on various devices (especially mobile)? Here's my solution.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<title>Test Page</title>
<script>
// early compute the vw/vh units more reliably than CSS does itself
computeViewportDimensions();
@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

@souzagab
souzagab / OpenSSL-Fix.md
Last active December 24, 2023 06:26
Install OpenSSL 1.0.2 via Homebrew ( Fix for older Ruby Versions )

How to fix openSSL incompatibility issues in older Ruby Versions. (<=2.3)

Homebrew

Install openssl 1.0.2 via homebrew :

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/64555220bfbf4a25598523c2e4d3a232560eaad7/Formula/openssl.rb -f

This should install openssl in /usr/local/opt/openssl

If you already have 1.1 installed, you should have 2 versions of opensll in: /user/local/opt/

{
"compilerOptions": {
"module": "commonjs",
"target": "ES6",
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
},
"rootDirs": [
"src"
@mattlevine
mattlevine / rebuild.cfm
Last active May 27, 2018 20:12 — forked from eballisty/rebuild.cfm
Rebuild Mura's default database indexes
<cfscript>
dbUtility.setTable('tcontent')
.addPrimaryKey('TContent_ID')
.addIndex('ContentID')
.addIndex('ContentHistID')
.addIndex('SiteID')
.addIndex('ParentID')
.addIndex('RemoteID')
.addIndex('ModuleID')
.addIndex('changesetID')
@onildoaguiar
onildoaguiar / sorting-an-array-by-date-with-moment-js.md
Last active May 21, 2024 15:15
Sorting an array by date with Moment.js
const Moment = require('moment')
const array = [{date:"2018-05-11"},{date:"2018-05-12"},{date:"2018-05-10"}]
const sortedArray  = array.sort((a,b) => new Moment(a.date).format('YYYYMMDD') - new Moment(b.date).format('YYYYMMDD'))
console.log(sortedArray)
@mattlevine
mattlevine / muraMethodInjection.cfm
Created April 27, 2018 19:22 — forked from stevewithington/muraMethodInjection.cfm
Mura CMS : You can easily override nearly any method in Mura with method injection. This example shows you how to do that.
<cfscript>
// drop this in your eventHandler.cfc
public any function yourMethod() {
// you do something here
}
public any function onApplicationLoad($) {
arguments.$.getBean('someBean').injectMethod('someMethod', yourMethod);
}
@mattlevine
mattlevine / muraRelatedContent.cfm
Created April 27, 2018 19:22 — forked from stevewithington/muraRelatedContent.cfm
Mura CMS : Related Content Iterators and outputting extended attributes
<cfoutput>
<cfscript>
// Content Bean of the Section of the site to narrow feed down to
cBean = $.getBean('content').loadBy(title='Blog');
// Feed Bean
fBean = $.getBean('feed');
fBean.addParam(
relationship='and'

DOCKER FIRST (Webinar)

7.1 was designed with a Docker first work flow in mind.

Docker allows increased support for Continuous Deployment and Testing, Multi-Cloud Platforms, Environment Standardization and Version Control. As well as better Isolation and Security (stolen from https://dzone.com/articles/5-key-benefits-docker-ci)