Skip to content

Instantly share code, notes, and snippets.

View BlaiseGratton's full-sized avatar

Blaise Gratton BlaiseGratton

  • Givful
  • Nashville, TN
View GitHub Profile

Write a query to display all records in the orders table

SELECT * FROM orders;

Show me the employees whose name starts with A.

SELECT * FROM employees WHERE first_name ILIKE 'A%';

Show me the employees whose first name starts with A or last name ends with N.

@BlaiseGratton
BlaiseGratton / tnopendatafetcher.js
Last active March 1, 2016 19:32
microservice hook for hackIT project
module['exports'] = function fetchData(hook) {
var request = require('request');
var responses;
var filteredResponses = [];
var options = {
url: "http://www.tdot.tn.gov/opendata/api/data/RoadwayMessageSigns",
method: "GET",
headers: {
apikey: "30c790d2b7b84867975220283669cbd0"
module['exports'] = function fetchData(hook) {
var request = require('request');
var responses;
var filteredResponses = [];
var options = {
url: "http://www.tdot.tn.gov/opendata/api/data/RoadwayMessageSigns",
method: "GET",
headers: {
apikey: "30c790d2b7b84867975220283669cbd0"
@BlaiseGratton
BlaiseGratton / tfs_integrations.md
Last active July 1, 2016 18:02
Gulp, Jasmine, Chutzpah, TypeScript, & ES6 Integration in TFS Xaml Builds

Integrating Gulp Processes into TFS Builds (and making them fail when they should)

Though the new TFS 2015 build process is out, you may still find yourself needing (or wanting?) for whichever reason to use the XAML build definitions for Team Foundation Server. "But how can we take advantage of modern front-end build tools to provide better organisation and ensure code quality while still using the XAML definitions?" you might ask. Hopefully this gist will get you there. As an exploratory process, a small task force of us at TDOT have configured a build definition such that a gulp process transpiles either TypeScript or ES6 (why not both?) into a separate output folder, runs Jasmine unit tests on the output script, and fails the build when the Jasmine tests fail.

Let's assume we have 3 models that look roughly like this:


An Artist class:

public class Artist
{
 [Key]

Given User and Tweet models, how would you structure RESTful urls for the following information:

  • a list of a given user's tweets

  • a list of a given user's followers

  • a list of a given user's feed (a combination of multiple users)

What would backend methods (you can use pseudocode) look like for each of these?

@BlaiseGratton
BlaiseGratton / gist:cade6ab7d0696e1b5788b536d40a5680
Last active June 21, 2019 23:14
Implementing styled components reusable with React Native

By writing a small adapter to choose the import path (styled-components vs styled-components/native), we should be able to import web UI components into a React Native context. This is accomplished by:

  1. Writing the adapter
  2. Configuring each project (web vs native) to import the right path for styled-components

The web project can easily set up a package alias in the next.config.js. The working setup I have is this:

const path = require("path");

module.exports = {
 webpack: config => {