Skip to content

Instantly share code, notes, and snippets.

View litewarp's full-sized avatar

Nick Sethi litewarp

View GitHub Profile
@litewarp
litewarp / Simple Form.md
Created August 29, 2017 19:46 — forked from stevenyap/Simple Form.md
Simple Form Cheatsheet

Gemfile

gem 'simple_form'

Installation

rails generate simple_form:install
@litewarp
litewarp / capybara cheat sheet
Created September 2, 2017 00:14 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
--- dsdt.dsl 2018-03-04 16:00:00.866484238 -0800
+++ dsdt.dsl 2018-03-04 16:28:07.933272752 -0800
@@ -18,9 +18,8 @@
* Compiler ID "INTL"
* Compiler Version 0x20160527 (538314023)
*/
-DefinitionBlock ("", "DSDT", 2, "LENOVO", "SKL ", 0x00000000)
+DefinitionBlock ("", "DSDT", 2, "LENOVO", "SKL ", 0x00000001)
{
- External (_GPE.TBNF, MethodObj) // 0 Arguments
@litewarp
litewarp / X1Y3_Sleep_Patch.txt
Created December 28, 2018 21:02
DSDT Sleep Fix For Lenovo X1 Yoga 3rd Gen (20LD) Bios 1.27
# Lenovo X1 Yoga 3rd Gen (20LD) DSDT Sleep Patch
# For Use with Bios 1.27
# Patch by Litewarp based on Linux X1Y3 Sleep Patch
# https://gist.github.com/litewarp/1a91726219402ab878d68647ba1be53b
# Credit to RehabMan and rickybrent
# External Fixes
# Regex matches to complete path with use of ','
# For example (_PCI0.RP01.PXSX, does not match on child objects
@litewarp
litewarp / rvm2rbenv.txt
Created April 18, 2019 18:22 — forked from brentertz/rvm2rbenv.txt
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@litewarp
litewarp / recovery.sh
Created July 23, 2019 17:43 — forked from jonathantneal/recovery.sh
Create or update macOS Mojave Recovery Partition Without Reinstalling
#!/bin/sh
# Set the macOS installer path as a variable
MACOS_INSTALLER="/Applications/$(ls /Applications | grep "Install macOS")"
MOUNT_POINT="$MACOS_INSTALLER/Contents/SharedSupport"
echo "macOS installer is \"$MACOS_INSTALLER\""
# Set the target disk as a variable
TARGET=$(diskutil info "$(bless --info --getBoot)" | awk -F':' '/Volume Name/ { print $2 }' | sed -e 's/^[[:space:]]*//')
echo "Target disk is \"$TARGET\""
@litewarp
litewarp / Combobox.ts
Created March 16, 2021 19:37
Downshift Combobox Compound Component
import React from 'react'
import {
useCombobox,
UseComboboxProps,
UseComboboxReturnValue,
} from 'downshift'
type Item = Record<string, any>
const ComboboxContext = React.createContext<UseComboboxReturnValue<Item>>(null)
@litewarp
litewarp / neo4j.ts
Last active November 2, 2022 13:37
Neo4j GraphQL Auth Workaround
export const neoSchema = new Neo4jGraphQL({
typeDefs,
resolver,
config: {
jwt: {
// create your own secret
secret: process.env.JWT_SECRET as string,
}
}
})
@litewarp
litewarp / wrapper.ts
Last active July 4, 2021 19:27
Neo4j Work-Around for Apollo Argument Name Constraints
// temporary fix for https://github.com/neo4j/graphql/issues/292
import { wrapSchema, RenameInputObjectFields } from '@graphql-tools/wrap'
import { Neo4jGraphQL } from '@neo4j/graphql'
import { typeDefs } from './typeDefs'
// renames all InputObjectFields matching 'skip'
// see https://www.graphql-tools.com/docs/schema-wrapping#renaming
const renamingFn = (typeName: string, fieldName: string): string => {
// adapted twin version of below
import { Fragment } from 'react'
import { Popover, Transition } from '@headlessui/react'
import { MenuIcon, XIcon } from '@heroicons/react/outline'
import 'twin.macro'
const navigation = [
{ name: 'Product', href: '#' },
{ name: 'Features', href: '#' },
{ name: 'Marketplace', href: '#' },