Skip to content

Instantly share code, notes, and snippets.

Nick Retallack nickretallack

Block or report user

Report or block nickretallack

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'HOST': 'localhost',
'NAME': 'db',
'USER': 'root',
'PASSWORD': '',
'OPTIONS': {
'charset': 'utf8mb4',
'init_command': 'set collation_connection=utf8mb4_unicode_ci',
View not_ok.rs
#[derive(Debug)]
struct Point {
x: f32,
y: f32,
}
#[derive(Debug)]
struct Rectangle {
p1: Point,
p2: Point,
View gist:0da8c6c4475a540b498fdebeb7ab297c
$ brew update
warning: unable to unlink CONTRIBUTING.md: Permission denied
warning: unable to unlink SUPPORTERS.md: Permission denied
fatal: cannot create directory at '.github': Permission denied
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
$ brew update
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mach (LoadError)
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Library/Homebrew/extend/pathname.rb:2:in `<top (required)>'
@nickretallack
nickretallack / error
Last active Oct 13, 2015
Why can't I put more than one level of
View error
Uncaught Error: Invariant Violation: Relay.QL: Expected query `viewer` to be empty. For example, use `node(id: $id)`, not `node(id: $id) { ... }`.
@nickretallack
nickretallack / query1.graphql
Last active Oct 13, 2015
Why does it do a second query instead of re-using the result?
View query1.graphql
fragment on Viewer {
files(first: 10) {
edges {
node {
id,
url,
},
},
},
}
View error
{
"errors": [
{
"message": "Argument \"input\" expected type \"UploadFileByUrlInput!\" but got: {url: foo}.",
"locations": [
{
"line": 1,
"column": 35
}
]
@nickretallack
nickretallack / request
Last active Oct 12, 2015
curl copy of a mutation?
View request
curl 'http://localhost:4000/graphql' -X POST -H 'Pragma: no-cache' -H 'Origin: http://localhost:4000' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36' -H 'content-type: application/json' -H 'Accept: */*' -H 'Cache-Control: no-cache' -H 'Referer: http://localhost:4000/?' -H 'Connection: keep-alive' -H 'Content-Length: 280' --compressed
@nickretallack
nickretallack / fails.js
Last active Oct 11, 2015
"this" is null in my handler. Am I doing something wrong here?
View fails.js
import 'babel/polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
class FileUploadPage extends React.Component {
handleSubmit(event) {
event.preventDefault();
console.log(this.refs.url.value.trim())
}
@nickretallack
nickretallack / pokemon.js
Created Oct 8, 2015
Resolvers for a Pokemon GraphQL API
View pokemon.js
let Users = []
function getUser(name) {
return Users.find(user => user.name == name)
}
function upsertUser(name) {
let user = getUser(name)
if (!user) {
user = {
@nickretallack
nickretallack / README.md
Created Sep 29, 2015
This will notify you when things change in undertale.ini.
View README.md

How to use:

  • Install Python
  • Install Python Watchdog: pip install watchdog
  • Put undertailer.py next to undertale.ini
  • Run it from the commandline: python undertailer.py
  • Play undertale and watch the commandline output
You can’t perform that action at this time.