Skip to content

Instantly share code, notes, and snippets.

View ippy04's full-sized avatar

Justin Ip ippy04

View GitHub Profile
@ivanionut
ivanionut / nginx-proxy.conf
Created June 3, 2020 14:26 — forked from fhferreira/nginx-proxy.conf
Proxy nginx to use Google Tag Manager
# Google Analytics Bypassing Adblockers
## Client
change www.googletagmanager.com => your.domain.com
```
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://your.domain.com/gtag/js?id=UA-123456789-1"></script>
```
@agrberg
agrberg / environment.js
Created April 11, 2020 16:40
Getting webp images and autogeneration working in Rails 6
const IMAGE_REGEXP = /\.(?:jpe?g|png)$/; // https://regexper.com/#%2F%5C.%28%3F%3Ajpe%3Fg%7Cpng%29%24%2F
const ImageminWebpWebpackPlugin = require('imagemin-webp-webpack-plugin');
const { environment } = require('@rails/webpacker');
environment.plugins.prepend('ImageminWebpWebpackPlugin', new ImageminWebpWebpackPlugin({
silent: false,
detailedLogs: true,
}));
const manifest = environment.plugins.get('Manifest')
@fhferreira
fhferreira / nginx-proxy.conf
Created August 16, 2019 02:52
Proxy nginx to use Google Tag Manager
# Google Analytics Bypassing Adblockers
## Client
change www.googletagmanager.com => your.domain.com
```
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://your.domain.com/gtag/js?id=UA-123456789-1"></script>
```
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active May 22, 2024 13:44
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
'use strict';
var request = require('request');
function HTTPSProxyTransport() {}
HTTPSProxyTransport.prototype.send = function (client, message, headers, eventId, cb) {
var options = {
url: 'https://' + client.dsn.host + client.dsn.path + 'api/' + client.dsn.project_id + '/store/',
headers: headers,
method: 'POST',
@foklepoint
foklepoint / .gitlab-ci.yml
Created July 8, 2017 20:25
Build and Push images to GCP Container Registry with Gitlab CI
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
GCP_PROJECT_ID: CHANGE-TO-GCP-PROJECT-ID
IMAGE_NAME: image_id
services:
@caseywatts
caseywatts / quicktime-hangouts-recording.md
Last active February 14, 2024 02:18
Quicktime Hangouts Recording (using soundflower for audio)

Short link to this page: caseywatts.com/quicktime

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Quicktime + Hangouts Recording

Scenario: You want to talk with someone over google hangouts (like for a user study), and you want to record BOTH:

@markerikson
markerikson / appEntryPoint.js
Last active August 1, 2022 07:41
Webpack React/Redux Hot Module Reloading (HMR) example
import React from "react";
import ReactDOM from "react-dom";
import configureStore from "./store/configureStore";
const store = configureStore();
const rootEl = document.getElementById("root");
@Hagbarth
Hagbarth / HBTimezone.h
Created November 18, 2015 01:24
React native get local timezone from iOS system
#import <Foundation/Foundation.h>
#import "RCTBridgeModule.h"
@interface HBTimezone : NSObject <RCTBridgeModule>
@end