Skip to content

Instantly share code, notes, and snippets.

View virajkulkarni14's full-sized avatar
💻
Code on...

Viraj G. Kulkarni (विराज गु. कुलकर्णी) virajkulkarni14

💻
Code on...
View GitHub Profile
@virajkulkarni14
virajkulkarni14 / DockerContainerRule.java
Created May 27, 2020 00:05 — forked from mosheeshel/DockerContainerRule.java
JUnit @rule for starting a docker container from within an Integration test
package rules;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.spotify.docker.client.DefaultDockerClient;
import com.spotify.docker.client.DockerClient;
import com.spotify.docker.client.DockerException;
import com.spotify.docker.client.messages.ContainerConfig;
import com.spotify.docker.client.messages.ContainerCreation;
import com.spotify.docker.client.messages.HostConfig;
@virajkulkarni14
virajkulkarni14 / CLI
Created May 11, 2020 01:23 — forked from colbyfayock/CLI
Links and stuffs to read or eventually get to.
http://explainshell.com/
http://www.cyberciti.biz/faq/linux-unix-bsd-xargs-construct-argument-lists-utility/
@virajkulkarni14
virajkulkarni14 / aliases.zsh
Created May 11, 2020 01:22 — forked from colbyfayock/aliases.zsh
Remove local branches that merged into the specified branch
# Example Usage: gpb develop
# Removes any branches that were already merged into develop
gpb() {
BRANCH=$1
BRANCHES_TO_CLEAN=$(git branch --merged=$BRANCH | grep -v $BRANCH)
echo "Branches that have been merged to develop:"
echo $BRANCHES_TO_CLEAN
read -q "REPLY?Remove branches? (y/n)"
echo ""
@virajkulkarni14
virajkulkarni14 / loading.css
Created May 11, 2020 01:18 — forked from colbyfayock/loading.css
CSS Loading Animation
/**
* Loading Animation Snippet
*/
.loading {
color: transparent;
background: linear-gradient(100deg, #eceff1 30%, #f6f7f8 50%, #eceff1 70%);
background-size: 400%;
animation: loading 1.2s ease-in-out infinite;
}
const CustomInput2 = ({ onChange }) => {
const handleChange = (e) => {
const newValue = getParsedValue(e.target.value);
onChange(newValue);
};
return (
<Input onChange={handleChange} />
)
}
import React, { useState } from 'react';
const Form = () => {
const [name, setName] = useState('');
const handleChange = e => {
setName(e.target.value);
}
const handleSubmit = () => {
import React, { useState } from 'react';
const Form = () => {
const [name, setName] = useState('');
const handleChange = e => {
setName(e.target.value);
}
const handleSubmit = e => {
import React, { useState, useEffect } from 'react'
import { fetchUserAction } from '../api/actions.js'
const UserContainer = () => {
const [uset, setUser] = useState(null);
const handleUserFetch = async () => {
const result = await fetchUserAction();
setUser(result);
import React, { useState, useEffect, useCalllback } from 'react'
import { fetchUserAction } from '../api/actions.js'
const UserContainer = () => {
const [uset, setUser] = useState(null);
const handleUserFetch = useCalllback(async () => {
const result = await fetchUserAction();
setUser(result);
import React, { useState } from "react";
import PropTypes from "prop-types";
export const UserCard = ({ user }) => {
return (
<ul>
<li>{user.name}</li>
<li>{user.age}</li>
<li>{user.email}</li>
</ul>