Skip to content

Instantly share code, notes, and snippets.

View jeffrafter's full-sized avatar
You are amazing

Jeff Rafter (he/him) jeffrafter

You are amazing
View GitHub Profile
@jeffrafter
jeffrafter / useOnlineStatus.tsx
Last active August 18, 2023 12:57 — forked from patrickcze/useOnlineStatus.tsx
A basic hook to indicate if the user is online or offline
import React, { useState, useEffect, useContext } from "react"
const OnlineStatusContext = React.createContext(true)
type Props = {
children: React.ReactNode
}
export const OnlineStatusProvider: React.FC<Props> = ({ children }) => {
const [onlineStatus, setOnlineStatus] = useState<boolean>(typeof navigator !== "undefined" ? navigator.onLine : false)
@jeffrafter
jeffrafter / .gitignore
Last active January 25, 2017 17:30 — forked from BennettSmith/.gitignore
Google Protobuf v2.6.0 Build Script for iOS
protobuf
protobuf-2.6.0
protobuf-2.6.1
protobuf-master
# https://gist.github.com/mattetti/7624413
#
# Hack to change the Rails cookie serializer from Marshal to JSON and therefore allow the session
# to be shared between different languages but also avoid that someone knowing the
# cookie secret key could execute arbitrary code on the server by unmarshalling
# modified Ruby code added to the session/permanent cookie.
#
# Note that all users will need to login again since both the remember me cookie and the session cookies
# won't be valid. Note also that the remember me cookie is tested multiple times per request even when it fails.
# for performance reasons you might want to delete it if these extra cycles are too costly for you.
@jeffrafter
jeffrafter / growth.md
Last active December 21, 2015 07:38 — forked from kneath/growth.md

Hack on github.com with Kyle Neath

At GitHub, they've set out to GitHub be the best place to share code with friends, co-workers, classmates, and complete strangers.

Already, over three million people use GitHub to build amazing things together.

But that isn't enough. Everyone should enjoy the benefits of Git and everyone should Fork everything.

It turns out GitHub needs your help. You can be GitHub's partner in crime to help Kneath out.

def run
command = "gem install #{gemspec_helper.gem_path}"
output.puts "Executing #{command.inspect}:"
sh sudo(command)
end
def sudo(command)
"#{'sudo ' if use_sudo?}#{command}"
end