Skip to content

Instantly share code, notes, and snippets.

View tim-phillips's full-sized avatar

Tim Phillips tim-phillips

  • Los Angeles
View GitHub Profile
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@schmich
schmich / npm-prerelease.md
Last active January 3, 2024 18:19
Publish a prerelease package to NPM
  • Update package.json, set version to a prerelease version, e.g. 2.0.0-rc1, 3.1.5-rc4, ...
  • Run npm pack to create package
  • Run npm publish <package>.tgz --tag next to publish the package under the next tag
  • Run npm install --save package@next to install prerelease package
==========================
How Software Companies Die
==========================
- Orson Scott Card
The environment that nurtures creative programmers kills management and
marketing types - and vice versa.
Programming is the Great Game. It consumes you, body and soul. When
you're caught up in it, nothing else matters. When you emerge into
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@varmais
varmais / thinced.js
Created October 1, 2015 19:43
Geolocation to Promise wrap example
var getPosition = function (options) {
return new Promise(function (resolve, reject) {
navigator.geolocation.getCurrentPosition(resolve, reject, options);
});
}
getPosition()
.then((position) => {
console.log(position);
})
@dreamorosi
dreamorosi / standardJS-in-CRA.md
Last active August 16, 2022 17:33
Add Standard JS to create-react-app project

Standard JS in create-react-app

I've been using create-react-app lately as I find it very useful to kick things off while starting a project. I almost always follow JavaScript Standard Style and I found myself googling it so I figured out I should write it down.

Get Standard JS

I really like keeping dependencies as local as possible but if you prefer you can install it globally.

yarn add standard --dev

or

@watson
watson / airplay.md
Last active February 5, 2022 03:41
An overview over my AirPlay related modules
@ramiroaznar
ramiroaznar / query.sql
Created August 12, 2016 12:17
How to find duplicate values with PostgreSQL
select * from table t1
where (select count(*) from table t2
where t1.field = t2.field) > 1
order by field
@guyellis
guyellis / parseEmailsFromString.js
Created May 1, 2014 16:34
Allows a list of space,comma,semicolon,tab and newline delimited emails to be parsed into an array.
// Accepts a single paramater which is one or more emails separated
// by space,comma,semicolon,tab, or newline.
// Returns an array of tokens that should be emails
// Does not validate emails to see if they are well formed.
exports.parseEmails = function(emails) {
return emails.toLowerCase().split(/[\s,;\t\n]+/);
};
@robotnealan
robotnealan / sites-available-ghost
Last active March 20, 2019 09:33
DigitalOcean LetsEncrypt Nginx Config
server {
listen 80;
listen [::]:80;
server_name robertnealan.com;
root /var/www/ghost/system/nginx-root;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;