Skip to content

Instantly share code, notes, and snippets.

@marteinn
marteinn / _document.js
Created September 26, 2020 06:27
Next.js: How to capture and use page props in next/document
import Document, { Html, Head, Main, NextScript } from 'next/document';
class CustomDocument extends Document {
static async getInitialProps(ctx) {
let pageProps = null;
const originalRenderPage = ctx.renderPage;
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App) => (props) => {
@tuxedocat
tuxedocat / CityLights.icls
Last active September 21, 2022 17:01
[WIP] City Lights Color Scheme for IntelliJ IDEA: manually ported from https://github.com/Yummygum/city-lights-syntax-vsc
<scheme name="CityLights" version="142" parent_scheme="Darcula">
<metaInfo>
<property name="created">2019-01-04T13:46:48</property>
<property name="ide">Idea</property>
<property name="ideVersion">2018.3.2.0.0</property>
<property name="modified">2019-01-04T13:46:55</property>
<property name="originalScheme">CityLights</property>
</metaInfo>
<colors>
<option name="ADDED_LINES_COLOR" value="a3be8c" />

Frontend Masters: AWS for Frontend Engineers

You should have the following completed on your computer before the workshop:

  • Install the AWS CLI.
  • Have Node.js installed on your system. (Recommended: Use nvm.)
    • Install yarn with brew install yarn.
  • Create an AWS account. (This will require a valid credit card.)
  • Create a Travis CI account. (This should be as simple as logging in via GitHub).
@SylarRuby
SylarRuby / userAvatar.js
Last active June 21, 2024 14:48
NodeJs AWS S3 Upload
/**
* This gist was inspired from https://gist.github.com/homam/8646090 which I wanted to work when uploading an image from
* a base64 string.
* Updated to use Promise (bluebird)
* Web: https://mayneweb.com
*
* @param {string} base64 Data
* @return {string} Image url
*/
const imageUpload = async (base64) => {
@xameeramir
xameeramir / default nginx configuration file
Last active July 12, 2024 07:24
The default nginx configuration file inside /etc/nginx/sites-available/default
# Author: Zameer Ansari
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@joepie91
joepie91 / express-server-side-rendering.md
Last active July 3, 2024 03:16
Rendering pages server-side with Express (and Pug)

Terminology

  • View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
  • View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
  • HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
  • String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
#1B2B34,#4F5B66,#5FB3B3,#ffffff,#4F5B66,#FFFFFF,#5FB3B3,#EC5f67
@ErisDS
ErisDS / examples.md
Last active July 2, 2024 23:52
Ghost Filter Query examples

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});

GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3

@sptz45
sptz45 / gulpfile.js
Created February 24, 2015 20:35
Minimal Gulp setup with ReactJs, Browserify, LESS and BrowserSync for Play Framework
var gulp = require('gulp'),
browserify = require('gulp-browserify'),
browserSync = require('browser-sync'),
less = require('gulp-less');
var path = {
js: {
src: 'assets/javascripts/',
dest: 'target/web/public/main/javascripts/'
},
@RichardBronosky
RichardBronosky / multiple_ssh_setting.md
Last active June 5, 2024 19:16 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"