Skip to content

Instantly share code, notes, and snippets.

View ggamel's full-sized avatar
👁️
 👄  👁

Greg Gamel ggamel

👁️
 👄  👁
View GitHub Profile
@faustinoaq
faustinoaq / myAngular.html
Last active November 16, 2024 11:47
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
@searls
searls / extension_murderer_controller.js
Last active August 16, 2024 12:23
There's no way for web developers to prevent 1Password from thinking it can fill one-time-passwords (OTP) if they have autocomplete=one-time-code. This is madness, because 80% of these are SMS/email, and 1Password offers no way to fill these.
import { Controller } from '@hotwired/stimulus'
const BANNED_NODES = ['com-1password-button', 'com-1password-menu']
export default class extends Controller {
connect () {
this.observer = new window.MutationObserver(mutations => {
mutations.forEach(mutation => {
mutation.addedNodes.forEach(node => {
if (BANNED_NODES.includes(node.nodeName.toLowerCase())) {
node.remove()
@velzie
velzie / manifest-v2-chrome.md
Last active November 11, 2024 17:49
How to keep using adblockers on chrome and chromium

How to keep using adblockers on chrome and chromium

  1. google's manifest v3 has no analouge to the webRequestBlocking API, which is neccesary for (effective) adblockers to work
  2. starting in chrome version 127, the transition to mv3 will start cutting off the use of mv2 extensions alltogether
  3. this will inevitably piss of enterprises when their extensions don't work, so the ExtensionManifestV2Availability key was added and will presumably stay forever after enterprises complain enough

You can use this as a regular user, which will let you keep your mv2 extensions even after they're supposed to stop working

Linux

In a terminal, run:

@realvjy
realvjy / ChoasLinesShader.metal
Last active October 23, 2024 20:57
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@wb-softwares
wb-softwares / tinder.swift
Last active April 15, 2024 13:53
Recreating the Tinder home screen using SwiftUI and Swift Playgrounds on iPad
import SwiftUI
import PlaygroundSupport
struct Screen: View {
@State var size: CGSize = .zero
var body: some View {
//Lets Start with our Tinder Home Screen Recreate
//First, we need entire background to be gray-ish color. ZStack puts different views on top of each other.
ZStack {
import SwiftUI
import PlaygroundSupport
struct Screen: View {
var body: some View {
TabView {
InstagramHome().tabItem {
Image(systemName: "house.fill")
}
Text("Instagram").tabItem {
@nathanborror
nathanborror / ContentView.swift
Last active October 30, 2022 13:26
SwiftUI wrapper around Slack's PanModal (https://github.com/slackhq/PanModal)
import SwiftUI
import PanModal
struct ExampleView: View {
@State var detail: AnyView? = nil
@State var items: [String] = ["Detail 1", "Detail 2", "Detail 3"]
var body: some View {
NavigationView {
Seven different types of CSS attribute selectors
// This attribute exists on the element
[value]
// This attribute has a specific value of cool
[value='cool']
// This attribute value contains the word cool somewhere in it
[value*='cool']
import React from "react"
import { animated } from "react-spring"
import { Link } from "gatsby"
import "./nav.css"
const Nav = ({ style }) => (
<animated.nav style={style} className="nav">
<ul>
<li>
import React, { useState } from "react"
import PropTypes from "prop-types"
import { useSpring } from "react-spring"
import Header from "./header"
import Nav from "./nav"
import "./layout.css"
const Layout = ({ children }) => {
const [navOpen, toggleNavOpen] = useState(false)