Skip to content

Instantly share code, notes, and snippets.

View jergason's full-sized avatar
🦢
theft puts a parade in my walk

Jamison Dance jergason

🦢
theft puts a parade in my walk
View GitHub Profile
let UserContext = React.createContext();
class App extends React.Component {
state = {
user: null,
setUser: user => {
this.setState({ user });
}
};
@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@awd
awd / gist:601480
Created September 28, 2010 18:18
# this responder allows the system to render a streaming proc
# rendering a proc was removed in Rails 3.0
ActionController::Renderers.add :csv do |proc, options|
raise ArgumentError "CSV responder requires :filename" unless options.key? :filename
filename = options[:filename]
headers.merge!(
'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0',
'Content-Disposition' => "attachment; filename=\"#{filename}\"",