Skip to content

Instantly share code, notes, and snippets.

View diegowifi's full-sized avatar

Diego Ponce diegowifi

View GitHub Profile
@diegowifi
diegowifi / Stepper.js
Created August 28, 2019 15:11
Stepper component
import React, { Component, Fragment } from "react";
import styled, { css } from "styled-components";
const StepDot = styled.div`
display: flex;
align-items: center;
justify-content: center;
background-color: #d4d3d1;
width: 20;
height: 20;
@diegowifi
diegowifi / Avatar.js
Created August 19, 2019 21:17
Avatar component
import React from "react";
import ProfilePlaceholder from "../../assets/profile-placeholder.png";
const Avatar = ({ src = ProfilePlaceholder, size, circle }) => {
return (
<img
src={src}
onError={e => {
e.target.onerror = null;
e.target.src = ProfilePlaceholder;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="styles.css" />
<script src="main.js"></script>
{
"extends": ["airbnb", "prettier", "prettier/react"],
"parser": "babel-eslint",
"rules": {
"react/jsx-filename-extension": [
"error",
{ "extensions": [".js", ".jsx"] }
],
"no-underscore-dangle": [2, { "allowAfterThis": true }],
"prettier/prettier": [
@diegowifi
diegowifi / snippets.js
Created November 17, 2017 19:09
Handy jQuery snippets
// Act on scroll condition
var lastScrollTop = 0;
$(window).on('scroll', function() {
scrollPosition = $(this).scrollTop();
if(scrollPosition < lastScrollTop) { // Do something on scroll up }
else { // Do something on scroll down }
lastScrollTop = scrollPosition;
});
@diegowifi
diegowifi / .csscomb.json
Last active May 10, 2017 02:44
JSON file for CSScomb's configuration, with alphabetical order enabled.
{
"exclude": [
".git/**",
"node_modules/**",
"bower_components/**"
],
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "upper",
"block-indent": " ",
@diegowifi
diegowifi / gist:62f2a5a214cb34f14409
Created December 28, 2015 09:39
Find (and kill) process locking port 3000
Find:
lsof -i :3000
Kill:
kill -9 <PID>
<!DOCTYPE html>
<html ng-app="people">
<head>
<meta charset="UTF-8">
<title>FrontEnd Test</title>
</head>
<body ng-controller="PeopleController as people">
<div>
<table border="1">
<tr>
<h2>
1. The Period
</h2>
<blockquote>
It was the best of times,<br>it was the worst of times,<br> it was the age of
wisdom,<br> it was the age of foolishness,<br> it was the epoch of belief,<br> it
was the epoch of incredulity,<br> it was the season of Light,<br> it was the
season of Darkness,<br> it was the spring of hope,<br> it was the winter of
despair,
</blockquote>
@diegowifi
diegowifi / gist:06dacc97d84a48f5b68f
Created May 7, 2015 00:02
Fix XAMPP's Apache shit on Ubuntu
First you should stop your apache server:
sudo /etc/init.d/apache2 stop
Then stop mysql:
sudo /etc/init.d/mysql stop
sudo /etc/init.d/proftpd stopv