Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠

Tony Ghita tonyghita

🤠
View GitHub Profile
View graphql-talks.md

Recommended GraphQL talks

This is not an exhaustive list, but should be enough to get you started.

Lee Byron - Exploring GraphQL (2015)

Lee explores GraphQL's core principles, how it works, and what makes it a great tool.

https://www.youtube.com/watch?v=WQLzZf34FJ8

View keybase.md

Keybase proof

I hereby claim:

  • I am tonyghita on github.
  • I am tonyghita (https://keybase.io/tonyghita) on keybase.
  • I have a public key ASAa8WiU7sdrLDQBBaKZDy0GcKlTixkGisXB9csn5bourgo

To claim this, I am signing this object:

@tonyghita
tonyghita / dataloader_resolver.go
Last active Jan 29, 2018
Example integration of graphql-go resolvers and dataloader
View dataloader_resolver.go
type RootResolver struct {
UsersClient users.client
}
type UserResolver struct {
id string // We can forgo a user lookup in the case a field resolvers only needs the user's id (e.g. fetching a user's friends).
load dataloader.Thunk // call this function to load user for field resolution
}
// loadUsers gets passed to the request-specific dataloader as the batch function
View routes.js
if (devMiddleware) {
app.get('*', (req, res) => {
res.write(devMiddleware.fileSystem.readFileSync(path.join(__dirname, '../..', 'build', 'index.html')))
res.end()
})
} else {
app.use(express.static(path.join(__dirname, '../..', 'build')))
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, '../..', 'build', 'index.html'))
})
View bootstrap-masonry-template.htm
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">
@tonyghita
tonyghita / .gitconfig
Created Aug 29, 2014
Alias for checkout out pull-requests locally
View .gitconfig
[alias]
co-pr = !sh -c 'git fetch origin pull/$1/head:pr/$1 && git checkout pr/$1' -
@tonyghita
tonyghita / prepare-commit-msg
Created Jun 25, 2012
git hook which prepends the branch name to the commit message
View prepare-commit-msg
#!/usr/bin/env ruby
branchname = `git describe --contains --all HEAD`
message_file = ARGV[0]
message = File.read(message_file)
File.open(message_file, 'w') {|f| f.write branchname + message }