├── .env ├── .gitignore ├── .nowignore ├── README.md ├── components ├── AddButton.js ├── CommentBox.js ├── Footer.js ├── HackCard.js ├── Header.js ├── Layout.js ├── NotifyMeModal.js ├── PaginationBox.js ├── PostFilters.js └── SearchInput.js ├── config └── global.js ├── now.json ├── package.json ├── pages ├── _app.js ├── contributors.js ├── index.js ├── post.js ├── search.js ├── sitemap.js └── tag.js ├── server.js ├── sitemap.js ├── static ├── images │ ├── daily-hack-favicon.png │ ├── daily-hack-image.png │ ├── daily-hack-logo.png │ └── header-left-vector.png ├── sitemap.xml └── style.scss └── yarn.lock /.env: -------------------------------------------------------------------------------- 1 | DAILYHACK_GITHUB_API="https://dailyhack.glitch.me/" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | package-lock.json 3 | .next/ -------------------------------------------------------------------------------- /.nowignore: -------------------------------------------------------------------------------- 1 | .next 2 | node_modules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | DailyHack 4 | 5 |

6 |

7 | DailyHack 8 |

9 | 10 |

11 | 💡 :rocket: 12 |

13 |

14 | Website: https://dailyhack.now.sh/ 15 |

16 |

17 | It's a place where people share the daily hacks they use during development to make their life easy.
So, Do you have any hack to submit? 18 |

19 |

20 | 21 | Follow @gatsbyjs 22 | 23 |

24 | 25 | ## What’s In This Document 26 | 27 | - [About DailyHack](#-about-dailyhack) 28 | - [How to Add tricks](#-how-to-add-tricks) 29 | - [How to Contribute](#-how-to-contribute) 30 | - [Thanks to Our Contributors](#-thanks-to-our-contributors) 31 | - [License](#license) 32 | 33 |
34 | 35 | ## 📖 About DailyHack 36 | 37 | DailyHack is just an Idea about sharing the **hacks/tricks/shortcuts** we use in our daily life to develop and fix the things quick and smart way. It's a community of makers and geeks from around the world. Anyone can share their methods with other makers and developers. 38 | 39 |
40 | 41 | ## ✍ How to add tricks 42 | 43 | We are using the [GitHub Issue System](https://github.com/mddanishyusuf/dailyhack/issues) as a CMS. So, it's easy to add your tricks. Just create an issue and write your hack into an editor and submit. After you submit the author/editors will set the tags to your issues and it will show [on the website](https://dailyhack.xyz/). 44 | 45 |
46 | 47 | ## 🤝 How to Contribute 48 | 49 | Adding tricks is a big contribution to the open-source community. The website and the code in this repository is Open Source. So, you can make any improvements or changes you desire. 50 | 51 | [List of Contributors](https://dailyhack.xyz/contributors) 52 | 53 |
54 | 55 | ### Website Build With 56 | 57 | - **Next.js**- For SSR, Front-end I use [Styled JSX](https://nextjs.org/blog/styling-next-with-styled-jsx). 58 | - **GitHub Issues:** As a CMS for tricks 59 | - **Glitch:** A layer on the GitHub API to secure access_token 60 | - **Zeit:** To host the application 61 | 62 |
63 | 64 | ## 💜 Thanks to Our Contributors 65 | 66 | Thanks to our many contributors and friends who give their time to add tricks. 67 | 68 |
69 | 70 | ## License 71 | 72 | [![CC0](http://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg)](https://creativecommons.org/publicdomain/zero/1.0/) 73 | -------------------------------------------------------------------------------- /components/AddButton.js: -------------------------------------------------------------------------------- 1 | import Link from 'next/link'; 2 | import { PlusSquare } from 'react-feather'; 3 | 4 | const AddButton = () => ( 5 |
6 |
7 | 10 |
11 | 44 | 45 |
46 | ) 47 | 48 | export default AddButton; -------------------------------------------------------------------------------- /components/CommentBox.js: -------------------------------------------------------------------------------- 1 | import React, {useEffect, useState} from 'react'; 2 | import axios from 'axios'; 3 | import moment from 'moment' 4 | import Markdown from 'markdown-to-jsx'; 5 | import {GITHUB_ENDPOIINT_LOCAL} from '../config/global' 6 | 7 | const HyperLink = ({ children, ...props }) => ( 8 | {children} 9 | ); 10 | 11 | const Comments = function(props){ 12 | const {comments} = props; 13 | 14 | return ( 15 |
16 |
Do you have any comment on this tricks? then let the author know about that. comment here
17 | { 18 | comments.length > 0 19 | ? 20 |
21 | {comments.map((comment, key)=> { 22 | return( 23 |
24 |
25 |
26 | 27 |
28 |
29 |
{comment.user.login}
30 |
{moment(comment.created_at).fromNow()}
31 |
32 |
33 |
34 | {comment.body} 44 | 45 |
46 |
47 | ) 48 | })} 49 |
50 | : 'This post have comments' 51 | } 52 | 88 |
89 | ) 90 | } 91 | 92 | const CommentBox = function(props){ 93 | 94 | const [comments, setComments] = useState([]) 95 | 96 | useEffect(()=> { 97 | axios.get(`${GITHUB_ENDPOIINT_LOCAL}/issues/${props.single_issue.number}/comments`).then(res=>{ 98 | setComments(res.data) 99 | }) 100 | },[]) 101 | 102 | return ( 103 |
104 |
105 |
106 | { 107 | comments.length > 0 108 | ? 109 | :
Do you have any comment on this tricks? then let the author know about that. comment here
110 | } 111 |
112 | 132 |
133 | ) 134 | } 135 | 136 | export default CommentBox; -------------------------------------------------------------------------------- /components/Footer.js: -------------------------------------------------------------------------------- 1 | import Link from 'next/link' 2 | import { Twitter, GitHub, Users, Info, HelpCircle } from 'react-feather'; 3 | 4 | const Footer = function(props) { 5 | return ( 6 | 94 | ) 95 | } 96 | 97 | export default Footer; 98 | -------------------------------------------------------------------------------- /components/HackCard.js: -------------------------------------------------------------------------------- 1 | import Markdown from 'markdown-to-jsx'; 2 | import getSlug from 'speakingurl' 3 | import Link from 'next/link'; 4 | import { Tag, Heart, MessageSquare, Twitter, Facebook } from 'react-feather'; 5 | import moment from 'moment' 6 | 7 | const HyperLink = ({ children, ...props }) => ( 8 | {children} 9 | ); 10 | 11 | const HackCard = (props) => { 12 | const issue = props.single_issue 13 | return ( 14 |
15 |
16 |
17 | 18 |
19 |
{issue.user.login}
20 |
{moment(issue.created_at).fromNow()}
21 |
22 |
23 |
24 |
25 | {props.router.asPath !== '/' ?

{issue.title}

:

{issue.title}

} 26 | {issue.body} 36 |
37 |
38 |
39 |
    40 | 41 | {issue.labels !== undefined ? issue.labels.map(label => { 42 | return( 43 |
  • #{label.name}
  • 44 | ) 45 | }): ''} 46 |
    47 |
48 | 49 |
50 | 56 |
57 |
58 |
59 | 217 |
218 | ) 219 | } 220 | export default HackCard -------------------------------------------------------------------------------- /components/Header.js: -------------------------------------------------------------------------------- 1 | import {Fragment} from 'react'; 2 | import Link from 'next/link' 3 | import { withRouter } from 'next/router' 4 | import { Twitter, GitHub, Users, Bell, Coffee, Rss } from 'react-feather'; 5 | import AddButton from './AddButton' 6 | import NotifyMeModal from './NotifyMeModal'; 7 | import PostFilters from './PostFilters'; 8 | 9 | 10 | const Header = (props) => { 11 | return( 12 |
13 | {/*
🔥 Hey, we are on ProductHunt Today. Support Us there. Thanks
*/} 14 |
15 |
16 | 17 |
18 |
19 | 27 |
28 | 29 |
30 | 31 | {props.router.asPath === "/" ? 32 | 33 |
34 |

A Community of Makers and Geeks

35 |

It's a place where people share there daily hack they use in their developments. So, Do you have any hack?

36 | 37 |
38 | 39 | 40 |
41 | : ""} 42 | 43 | 141 | 142 |
143 | )} 144 | 145 | export default withRouter(Header); -------------------------------------------------------------------------------- /components/Layout.js: -------------------------------------------------------------------------------- 1 | import {Fragment} from 'react'; 2 | import Head from 'next/head'; 3 | 4 | import Header from './Header'; 5 | import Footer from './Footer'; 6 | 7 | const Layout = props => { 8 | return( 9 |
10 | 11 | 12 | 13 | {props.title} 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |