Skip to content

Instantly share code, notes, and snippets.

View bqst's full-sized avatar
:shipit:

Bastien bqst

:shipit:
View GitHub Profile
@VariableVic
VariableVic / google-analytics.ts
Last active April 5, 2024 21:40
Medusa -> Google Analytics 4 server side tracking example
import { TransactionBaseService } from "@medusajs/medusa";
import {
ConsentSettings,
EventItem,
JSONPostBody,
} from "../types/google-analytics";
const { subtle } = require("crypto").webcrypto;
@kconner
kconner / macOS Internals.md
Last active June 27, 2024 18:48
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@prologic
prologic / LearnGoIn5mins.md
Last active July 3, 2024 04:05
Learn Go in ~5mins
@horacioh
horacioh / gatsby-config.js
Created November 20, 2019 21:59
Gatsby config: PostCSS, Tailwind, Emotion, Prismic, Google Analytics, Manifest & Offline
/* eslint-disable jsx-a11y/rule-name */
const path = require("path")
require("dotenv").config({
path: `../.env.${process.env.NODE_ENV}`,
})
module.exports = {
siteMetadata: {
@munificent
munificent / generate.c
Last active May 14, 2024 05:30
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@maxivak
maxivak / webpacker_rails.md
Last active June 15, 2024 21:37
Webpack, Yarn, Npm in Rails
@crittermike
crittermike / App.js
Last active May 9, 2022 08:18
Using Google API (gapi) with React
/* global gapi */
const API_KEY = 'YOURAPIKEYHERE';
import React, { Component } from 'react';
class App extends Component {
loadYoutubeApi() {
const script = document.createElement("script");
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@tomi
tomi / README.md
Last active March 14, 2024 03:28
Saving and reading private key to env variables using base64

Encoding the private key as base64

  • Copy the private key to clipboard
  • Run command pbpaste | base64 | pbcopy
  • The private key is now base64 encoded in the clipboard. Paste it to env variable e.g. to heroku or to .env file

Decoding the private key from base64 in node.js

const private_key = new Buffer(process.env.PRIVATE_KEY, 'base64').toString('ascii');