Skip to content

Instantly share code, notes, and snippets.

View ottodevs's full-sized avatar
🥷
Hacking

Otto G ottodevs

🥷
Hacking
View GitHub Profile
import { component$, useVisibleTask$ } from "@builder.io/qwik";
import { useLocation } from "@builder.io/qwik-city";
// import the file we created
import { usePatternParamExtractor } from '~/hooks/pattern-param-extractor'
export default component$(() => {
const loc = useLocation();
@slorber
slorber / generate-docs-from-js.js
Last active April 2, 2024 19:37 — forked from arinthros/generate-docs-from-js
Generate Docusaurus Docs from JSDoc
/**
* Requires jsdoc and jsdoc-to-markdown
*/
/* eslint-disable no-console */
const fs = require('fs')
const path = require('path')
const glob = require('glob')
const { execSync } = require('child_process')
const jsdoc2md = require('jsdoc-to-markdown')
@fragosti
fragosti / recompose-primer.md
Created January 10, 2018 07:28
React Recompose Primer

React Recompose Primer

This primer will try to explain what recompose is by writing a non-recompose React component and then progressively refactoring it until you end up using withState from recompose.

import React, { Component} from 'react';

class MyComponent extends Component {
  state = {
    isShowingStuff: false,
  }

Logic composability problems of lifecycle hooks in React

Suppose I have these components in my project:

class MessageHeader extends React.Component { /* ... */ }

class NiceButton extends React.Component { /* ... */ }

class FridgeContents extends React.Component { /* ... */ }
@Bjvanminnen
Bjvanminnen / instructions.md
Last active January 8, 2023 15:52
How to use glslify with create-react-app

Create your app

create-react-app my-app
cd my-app

Eject it, so that we can modify webpack config

npm run eject
y # when prompted
@thomasmaclean
thomasmaclean / StringToLower.sol
Last active May 19, 2020 21:40
Ethereum/Solidity toLower() equivalent, to transform strings to lowercase
pragma solidity ^0.4.11;
contract StringToLower {
function _toLower(string str) internal returns (string) {
bytes memory bStr = bytes(str);
bytes memory bLower = new bytes(bStr.length);
for (uint i = 0; i < bStr.length; i++) {
// Uppercase character...
if ((bStr[i] >= 65) && (bStr[i] <= 90)) {
// So we add 32 to make it lowercase
@athityakumar
athityakumar / powerlevel9k.config
Created July 6, 2017 18:38
Powerlevel9k oh-my-zsh theme configuration for screenshots used in https://github.com/athityakumar/colorls
export ZSH=$HOME/.oh-my-zsh
export DEFAULT_USER='athityakumar'
TERM=xterm-256color
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_MODE='awesome-fontconfig'
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active May 7, 2024 13:38
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@n0ts
n0ts / brew-cask-upgrade.sh
Last active April 15, 2020 15:30
brew cask upgrade
#!/bin/bash
for c in $(brew cask list); do
info=$(brew cask info $c)
installed_ver=$(echo "$info" | cut -d$'\n' -f1 | tr -d ' ' | cut -d':' -f 2)
current_ver=$(echo "$info" | cut -d$'\n' -f3 | cut -d' ' -f 1 | rev | cut -d'/' -f 1 | rev)
if [ "$installed_ver" != "$current_ver" ]; then
echo "$c is installed '$installed_ver', current is '$current_ver'"
brew cask reinstall $c
fi
@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active May 5, 2024 10:12
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites