Skip to content

Instantly share code, notes, and snippets.

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@lolocoo
lolocoo / auth-hook.js
Created January 12, 2022 09:23 — forked from ulises-jeremias/auth-hook.js
Examples of hooks utils using axios, recoil.js, keycloak-js, @react-keycloak/web and more.
import { useCallback, useEffect, useState } from 'react';
import { useSetRecoilState } from 'recoil';
import { useKeycloak } from '@react-keycloak/web';
import { commonNotification } from './common';
/**
* Returns the auth info and some auth strategies.
*
*/
@lolocoo
lolocoo / ranking.php
Created January 11, 2019 10:05
ranking.php
<?php
$arr = [
['dmid' => 12, 'num' => 1],
['dmid' => 13, 'num' => 12],
['dmid' => 14, 'num' => 12],
['dmid' => 15, 'num' => 6],
['dmid' => 16, 'num' => 8],
['dmid' => 17, 'num' => 8],
['dmid' => 18, 'num' => 0],
['dmid' => 19, 'num' => 0],
@lolocoo
lolocoo / 1- tools.md
Created April 3, 2018 02:27 — forked from othorizon/1- tools.md
在线工具 汇总
@lolocoo
lolocoo / 1- tools.md
Created April 3, 2018 02:27 — forked from othorizon/1- tools.md
在线工具 汇总
@lolocoo
lolocoo / resume.md
Last active March 13, 2018 06:47
RocWang's Resume

个人信息

工作经历

北京行圆汽车信息技术有限公司 2017.01 - 至今

@lolocoo
lolocoo / introrx.md
Created January 19, 2018 07:12 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@lolocoo
lolocoo / introrx.md
Created January 19, 2018 07:12 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@lolocoo
lolocoo / car_slider.html
Created January 11, 2018 07:49
car_slider.html
<!DOCTYPE html>
<!--
Created using JS Bin
http://jsbin.com
Copyright (c) 2018 by anonymous (http://jsbin.com/kibowalije/1/edit)
Released under the MIT license: http://jsbin.mit-license.org
-->
@lolocoo
lolocoo / framework7_city_selector.vue
Created December 13, 2017 07:17
framework7_city_selector
var location = function (target) {
let vendors = {
api: 'http://184.api.kr.xingyuanauto.com/basedata/api?Method=Xy.Kr.BaseData.',
province: [''],
provinceDisplay: [''],
city: [''],
cityDisplay: [''],
cities: {},
citiesDisplay: {},
type: {