Skip to content

Instantly share code, notes, and snippets.

@shiya
shiya / how-to-squash-commits-in-git.md
Created June 26, 2018 22:42 — forked from patik/how-to-squash-commits-in-git.md
How to squash commits in git

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:

@shiya
shiya / pretty-console-log.json
Created January 22, 2018 19:36
Paste this in your javascript.json in vscode
"Pretty console.log": {
"prefix": "clp",
"body": [
"console.log(",
" '%c$1', ",
" 'background: #fff; color: #222; border-radius:5px; font-size: 12px; padding: 3px;'",
");"
],
"description": "make your console log stand out"
}
@shiya
shiya / three-component.js
Created December 20, 2017 00:56
A React component that uses three.js
// A simple 3D view for some geometries
import React, { Component } from 'react';
import * as THREE from 'three';
import './canvas.css';
let camera, scene, renderer;
class Canvas extends Component {
componentDidMount() {
@shiya
shiya / upload.js
Last active September 28, 2017 00:12
let uploadObj = () => {
let obj =
'o' +
'\nv -0.500000 -0.500000 0.500000' +
'\nv 0.500000 -0.500000 0.500000' +
'\nv -0.500000 0.500000 0.500000' +
'\nvt 0.000000 0.000000' +
'\nvt 1.000000 0.000000' +
'\nvt 0.000000 1.000000' +
'\nvn 0.000000 0.000000 1.000000' +
<body>
<form action="/" enctype="multipart/form-data" method="post">
<input type="file" name="file-to-upload">
<input type="submit" value="Upload">
</form>
</body>
### Keybase proof
I hereby claim:
* I am shiya on github.
* I am shiya (https://keybase.io/shiya) on keybase.
* I have a public key ASBY9mbhvHd3aidHqemKNqx41_phUpEwKUlp1ULeK1-gggo
To claim this, I am signing this object:
@shiya
shiya / three.js.shader.html
Created August 9, 2016 10:20 — forked from kylemcdonald/three.js.shader.html
Minimal three.js shader example.
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
margin: 0px;
overflow: hidden;
}
{
"master" : "urn:adsk.objects:os.object:shiyas-bucket-12345/Cylinder1.dwg",
"dependencies" : [{
"file" : "urn:adsk.objects:os.object:shiyas-bucket-12345/Cylinder2.dwg",
"metadata" : {
"childPath" : "Cylinder2.dwg",
"parentPath" : "Cylinder1.dwg"
}
}
]