Skip to content

Instantly share code, notes, and snippets.

View shivampip's full-sized avatar
🏡
In Quarantine

Shivam Agrawal shivampip

🏡
In Quarantine
View GitHub Profile
@shivampip
shivampip / draw.py
Created October 6, 2018 07:04
[Dragon Curve] #dragoncurve #dragon #curve #python #turtle
import turtle as t
import math
n= 21 # Number of folds
step= 1 # Step length
l= 2**n - 1
a= [0]*l
def fold(m, start, end, dir):
@shivampip
shivampip / package.json
Last active January 28, 2020 08:21
[Embadded on Medium]
{
"name": "ghtest",
"homepage": "https://shivampip.github.io/ghtest/",
"version": "0.1.0",
"private": true,
"dependencies": {
"gh-pages": "^2.2.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.3.0"
@shivampip
shivampip / Div_inside_div_margin_100.md
Last active February 3, 2020 18:45
Div inside div with 100% height/width and padding/margin

By setting this property with the value "border-box" it makes whichever element you apply it to not stretch when you add a padding or border. If you define something with 100px width, and 10px padding, it will still be 100px wide.

box-sizing: border-box;  // on parent
@shivampip
shivampip / css_div_h_v_align_center.css
Created February 3, 2020 06:49
CSS Vertical and Horizontal align center
.outer {
display: flex;
justify-content: center;
align-items: center;
}
.innter{
align-self: center; /*optional*/
}
@shivampip
shivampip / git_unix_store_credentials.md
Created November 18, 2019 14:50
Unix Store Git Credentials
  • Run this cmd
git config credential.helper store
  • Perform push/pull (it will ask username and password once and then store them)
  • Next time not username or password
@shivampip
shivampip / AboutCard.css
Created February 11, 2020 07:02
Profile Card for Web
.aboutCardHidden{
display: none;
}
.aboutCardWrapper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
display: flex;
@shivampip
shivampip / GithubCatRibbon.css
Created February 11, 2020 07:19
Github Cat Side Ribbon
.github-corner:hover .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
@keyframes octocat-wave {
0%,
100% {
transform: rotate(0)
}
20%,
@shivampip
shivampip / your-script.js
Created February 14, 2020 15:49
[MEDIUM][REACT][EXSC] script file
function helloLife(msg) {
console.log("LIFE: " + msg);
}
@shivampip
shivampip / App.js
Last active February 14, 2020 15:51
[Medium] Use External Script with React
import React from "react";
import Script from "react-load-script";
import Demo from "./Demo";
class App extends React.Component {
state = { scriptLoaded: false };
handleScriptError() {
console.log("Error while loading script");
}
@shivampip
shivampip / Demo.js
Created February 14, 2020 15:54
[MEDIUM][REACT][EX-SCR] demo component
import React from "react";
class Demo extends React.Component {
render() {
if (this.props.ready) {
window.helloLife("Hey There");
}
return <div>THis is a demo</div>;
}
}