Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Zahidul Hossain choyan

🎯
Focusing
View GitHub Profile
@jaydenseric
jaydenseric / RouteIndicator.mjs
Last active Apr 7, 2021
A route change indicator for Next.js using React hooks.
View RouteIndicator.mjs
import Router from 'next/router'
import React from 'react'
const DONE_DURATION = 250
export const RouteIndicator = () => {
const [loading, setLoading] = React.useState(null)
const [timeoutId, setTimeoutId] = React.useState(null)
const onLoad = () => setLoading(true)
@bgauduch
bgauduch / multiple-repository-and-identities-git-configuration.md
Last active Apr 16, 2021
Git config with multiple identities and multiple repositories
View multiple-repository-and-identities-git-configuration.md

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.

  • Add each public SSH keys to your git providers acounts.

  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:

@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active Apr 16, 2021
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
View webstoemp-gulpfile.js
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
View elC - The elementary OS Combobulator - A community project
#elC - The elementary OS Combobulator - There are many issues within the community that tend to come up a lot.
#I know many of them are open bug reports, but until they are patched we can provide a consolidated list of work-arounds.
#I think this will be helpful for newcomers and veterans alike
#enable ppas
sudo apt install -y software-properties-common python3-software-properties python-software-properties
#install elementary tweaks
sudo add-apt-repository -y ppa:philip.scott/elementary-tweaks
sudo apt update -y
@umidjons
umidjons / youtube-dl-download-audio-only-on-best-quality.md
Last active Mar 18, 2021
Download Audio from YouTube with youtube-dl
View youtube-dl-download-audio-only-on-best-quality.md

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@avinmathew
avinmathew / index.jsx
Created Aug 8, 2017
Multiple layouts with React Router v4
View index.jsx
import React from "react"
import { Route, Switch } from "react-router-dom"
const AppRoute = ({ component: Component, layout: Layout, ...rest }) => (
<Route {...rest} render={props => (
<Layout>
<Component {...props} />
</Layout>
)} />
)
@hrshovon
hrshovon / py_faster_rcnn_build.txt
Last active Jul 15, 2017
py-faster-rcnn: my attempt of building
View py_faster_rcnn_build.txt
This is how I managed to build py-faster-rcnn on my fresh installed 64bit Ubuntu 16.04.For those who dont know, py-faster-rcnn
if a caffe based python implementation of faster-rcnn for image localization. This is more of a note for me.
WARNING: My methods may not work for everyone and may be for the later versions.
This is a GPU supported build. Make sure you have an nvidia gpu(as recent as possible,I have a GTX 1050 Ti, and yes I know
it's by no means a very good gpu for the task.But it handles things nicely.).
Now I am also running Tensorflow-gpu installed via pip. That requires cuda toolkit 8.0 and cudnn 5.1
So,if we are to start from scratch,
1.Download cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb from nvidia website.
@fgilio
fgilio / axios-catch-error.js
Last active Apr 14, 2021
Catch request errors with Axios
View axios-catch-error.js
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@jimschubert
jimschubert / mime.csv
Created Mar 17, 2017
List of more common mime types from MDN, in CSV and TSV
View mime.csv
Name MIMEType Extension Description
aac audio/aac .aac AAC audio file
abw application/x-abiword .abw AbiWord document
arc application/octet-stream .arc Archive document (multiple files embedded)
avi video/x-msvideo .avi AVI: Audio Video Interleave
azw application/vnd.amazon.ebook .azw Amazon Kindle eBook format
bin application/octet-stream .bin Any kind of binary data
bz application/x-bzip .bz BZip archive
bz2 application/x-bzip2 .bz2 BZip2 archive
csh application/x-csh .csh C-Shell script
@jserrao
jserrao / url-segment.js
Created Jul 27, 2016
Get Last Segment of a URL in Javascript
View url-segment.js
var pageURL = window.location.href;
var lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1);
console.log(lastURLSegment);