Skip to content

Instantly share code, notes, and snippets.

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

Greg Gamel ggamel

👁️
 👄  👁
View GitHub Profile
@realvjy
realvjy / ChoasLinesShader.metal
Last active July 11, 2024 12:40
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)
const path = require('path')
const ogs = require('open-graph-scraper')
const prompts = require('prompts')
const low = require('lowdb')
const FileSync = require('lowdb/adapters/FileSync')
const selectDB = [
{
type: 'select',
name: 'db',
@mxcl
mxcl / detweet.swift
Last active December 23, 2023 23:22
Delete all tweets and favorites older than two months ago. Instructions in comment.
#!/usr/bin/swift sh
import Foundation
import PromiseKit // @mxcl ~> 6.5
import Swifter // @mattdonnelly == b27a89
let swifter = Swifter(
consumerKey: "FILL",
consumerSecret: "ME",
oauthToken: "IN",
oauthTokenSecret: "https://developer.twitter.com/en/docs/basics/apps/overview.html"

Fixing macOS 10.14, 10.15, 12

Dark main menu without the rest of dark mode

  1. Set Light mode
  2. defaults write -g NSRequiresAquaSystemAppearance -bool Yes
  3. Log out and log back in
  4. Set Dark mode