Skip to content

Instantly share code, notes, and snippets.

@scottyhq
scottyhq / merge-conflict-rebase.md
Created August 10, 2020 18:25
GitHub PR Merge Conflict Resolution with Rebase

How to rebase a pull request to fix merge conflicts

It's quite common to open up a pull request on GitHub and be confronted with the message This branch has conflicts that must be resolved. This situation arises when you create a feature branch on an older commit from the master branch. Maybe you forgot to run git pull master before git checkout -b geocoding_vignette or maybe a collaborator changed some of the same files on GitHub while you've been working on new things. There are many ways to fix this. One is using the Web Editor build into GitHub and fixing conflicts by hand. This works great if there are not too many conflicts.

Another technique is to rebase your pull request onto the master branch (Move your additional commits on top of the most recent master commit). This is conceptually clean, but sometimes confusing in practice to do cleanly. This example walks through the process where you want to do a rebase, and resolve conflicts by overwriting whatever is on the master branch with change

@Ciantic
Ciantic / Cargo.toml
Last active March 6, 2024 20:05
This example shows how to stream a file or shell execution stdout using Hyper and Futures (Rust)
[package]
name = "yourpackage"
version = "0.1.0"
authors = ["John Doe"]
edition = "2018"
[[bin]]
name = "example"
path = "stream-a-file-using-rust-hyper.rs"
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@ievans
ievans / index.js
Created June 6, 2019 17:49
electron-native-notify-1.1.6 malicious source code
const MainProcessNotification = require("electron").Notification;
const isRenderer = process && process.type === "renderer";
const isSupported = () => isRenderer ? "Notification" in window : MainProcessNotification.isSupported();
const renderNotify = (title, body) => {
const notification = new Notification(title, {
body: body
});
return notification
};
try {

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at robert.balicki@gmail.com or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active April 10, 2024 16:40
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
@cyan198
cyan198 / Readme.MD
Last active November 3, 2022 12:14
Setup WiFi with snap on Ubuntu Core

Connect to WiFi on Ubuntu Core using Snap

It was done on the following environment:

  • Raspberry Pi 3 Model B
  • OS: Ubuntu Core
  • Pi is connected to internet via Ethernet

Here are the overview of the steps:

@Che4ter
Che4ter / mozoptimize
Created March 17, 2017 08:39
Bulk mozjpeg optimizer on the current directory, works with spaces in filename
#!/bin/bash
# Compresses all .jpg/.jpeg and saves them to opt/
# works with spaces in filenames
# make sure you adjust the path to mozjpeg bin
# uses the mozilla mozjpeg encoder from https://github.com/mozilla/mozjpeg
# based on https://gist.github.com/sauramirez/e0ef5059ab637ed3e2cea090b504f385
# Che4ter - 2017
#Change to mozjpeg path
MOZJPEG='/opt/mozjpeg/bin/'
@peterdemartini
peterdemartini / command.sh
Last active March 28, 2024 17:49
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@gkhays
gkhays / DrawSineWave.html
Last active March 9, 2024 19:05
Oscillating sine wave, including the steps to figuring out how to plot a sine wave
<!DOCTYPE html>
<html>
<head>
<title>Sine Wave</title>
<script type="text/javascript">
function showAxes(ctx,axes) {
var width = ctx.canvas.width;
var height = ctx.canvas.height;
var xMin = 0;