Skip to content

Instantly share code, notes, and snippets.

This appears to be an issue with go1.4 on certain versions of macos: golang/go#17182
I was able to get it to work by bootstrapping with go1.7.1 instead of 1.4:
gvm install go1.7.1 -B
gvm use go1.7.1
export GOROOT_BOOTSTRAP=$GOROOT
I can then gvm install later versions of Go.
/** @var ContainerAwareEventManager $evm */
$evm = $em->getEventManager();
foreach ($evm->getListeners() as $event => $listeners) {
foreach ($listeners as $key => $listener) {
if (str_starts_with($key, '_service_')) {
$listener = substr($key, strlen('_service_') );
}
$evm->removeEventListener([$event], $listener);
}
@torian257x
torian257x / multiple_mix.md
Created November 4, 2021 15:04
multiple webpack.mix.js

I have a similar setup, wherein I load different main entry files for the admin area and the main app. I use the following setup:

    //webpack.mix.js .
    
    if (process.env.section) {
        require(`${__dirname}/webpack.mix.${process.env.section}.js`);
      }
@torian257x
torian257x / rem.scss
Created October 13, 2021 16:58
Pixels (px) to rem using scss / sass functions
$rem-baseline: 16px !default;
$rem-fallback: false !default;
$rem-px-only: false !default;
@function rem-separator($list, $separator: false) {
@if $separator == "comma" or $separator == "space" {
@return append($list, null, $separator);
}
@if function-exists("list-separator") == true {
#!/bin/bash
# $1 - file name
# $2 - string to find
# $3 - string to replace
git filter-branch -f --tree-filter "if [ -f $1 ];then sed -i s/$2/$3/g $1;fi"
@torian257x
torian257x / app.blade.php
Last active April 26, 2021 07:29
multi build of laravel mix with performance improvement for tailwindcss "yarn hot" -> javascript as hot, tailwind as watch
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
const useStateWithRef = (initialState) => {
const [state, _setState] = React.useState(initialState);
const ref = React.useRef(state);
const setState = React.useCallback(
(newState) => {
if (typeof newState === 'function') {
_setState(prevState => {
const computedState = newState(prevState);
ref.current = computedState;
return computedState;
(function($) {
// we create a copy of the WP inline edit post function
var $wp_inline_edit = inlineEditPost.edit;
// and then we overwrite the function with our own code
inlineEditPost.edit = function( id ) {
// "call" the original WP edit function
// we don't want to leave WordPress hanging
{
"name": "Myapp/Myapp",
"description": "",
"keywords": ["secret"],
"require": {
"php": ">=5.5.0",
"slim/slim": "3.0",
"slim/php-view": "^2.0",
"monolog/monolog": "^1.17",
"wepay/php-sdk": "^0.2",