Skip to content

Instantly share code, notes, and snippets.

View collegeimprovements's full-sized avatar
💭
☀️

Arpit Shah collegeimprovements

💭
☀️
View GitHub Profile
@collegeimprovements
collegeimprovements / SSL-certs-OSX.md
Created January 17, 2020 10:44 — forked from croxton/SSL-certs-OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@collegeimprovements
collegeimprovements / psql-with-gzip-cheatsheet.sh
Created December 27, 2019 15:07 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@collegeimprovements
collegeimprovements / git-pushing-multiple.rst
Created December 27, 2019 11:22 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

Google Analytics
March 20, 2019 at 6:16pm (Edited 4 months ago)
I'm implementing Google Analytics to Reach Router running inside a React Static app (hence checking if the document exists).
This seems to be working, but if I console.log the pageview attributes, they get logged twice on each page visit. What's causing this?
// My Analytics component
import React from "react";
import { Location } from "@reach/router";
import ReactGA from "react-ga";
@collegeimprovements
collegeimprovements / nginx-gzip.conf
Created June 6, 2019 05:34 — forked from kilhage/nginx-gzip.conf
Enables gzip compression for common mime types in nginx
# most people include something like this. don't.
# check your default nginx.conf, it's already covered in a much better way.
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";
# compress proxied requests too.
# it doesn't actually matter if the request is proxied, we still want it compressed.
gzip_proxied any;
# a pretty comprehensive list of content mime types that we want to compress
# there's a lot of repetition here because different applications might use different
// Place your settings in this file to overwrite the default settings
{
"http.proxyStrictSSL": false,
"editor.tabSize": 2,
"files.exclude": {
".vscode": false,
"**/_build": true,
"**/.cache": true,
"**/.DS_Store": true,
"**/.git": true,
https://gist.github.com/collegeimprovements/877930fefc0c87ac946751f9e517c14e
let UserContext = React.createContext();
class App extends React.Component {
state = {
user: null,
setUser: user => {
this.setState({ user });
}
};
@collegeimprovements
collegeimprovements / package.json
Created March 15, 2019 12:16
basic gatsby with essential libs
{
"name": "gatsby-starter-default",
"private": true,
"description": "A simple starter to get up and developing quickly with Gatsby",
"version": "0.1.0",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"dependencies": {
"date-fns": "^1.30.1",
"gatsby": "^2.1.34",
"gatsby-image": "^2.0.33",
@collegeimprovements
collegeimprovements / readme.md
Created March 8, 2019 05:27 — forked from arkadiyk/readme.md
Compiled EmberJS in Docker

Compiled EmberJS App in Docker

The biggest problem deploying compiled EmberJS apps as a container is the configuration defined during compile time and becomes part of the image. Which is not ideal as you probably want to move the image between QA/UAT and prod without any modification.

The solution I will describe here looks like a hack but it's been working for me.

  1. I put config <meta> tag into index.html: