Skip to content

Instantly share code, notes, and snippets.

View Qurus's full-sized avatar
🏠
Working from home

Uen's Qurus

🏠
Working from home
  • Uen Media
  • Frankfurt am Main
View GitHub Profile
@Qurus
Qurus / fix-homebrew-npm.md
Created May 16, 2017 11:35 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

Download Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.

# $ youtube-dl {course_link} --cookies {path_to_cookies_file}

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku. Why do this? Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

  • You want to deploy some straight-up HTML, CSS, JS, maybe a few images. Nothing fancy here.
  • You are in the root directory of your site (i.e. the directory that contains all subdirectories and files for the site)
  • The root directory contains a main HTML page, e.g. index.html
  • A Heroku app and remote are set up and ready to go

Steps

@Qurus
Qurus / fix_env
Last active September 11, 2017 14:21
#!/usr/bin/env bash
ENV_PATH="$(dirname $(dirname $(which pip)))"
SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)"
echo "Ensure the root of current virtualenv:"
echo " $ENV_PATH"
read -p "‼️ Say no if you are not sure (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "♻️ Removing old symbolic links......"
@Qurus
Qurus / 0_reuse_code.js
Created September 15, 2017 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Qurus
Qurus / .gitlab_ci.yml
Created September 22, 2017 15:29 — forked from agalisteo/.gitlab_ci.yml
Deploy from Gitlab CI to Dokku
variables:
DOKKU_HOST: 'dokku.host.es'
IP_DOKKU_HOST: '1.2.3.4'
SSH_DOKKU_PORT: '22'
PROJECT_NAME: 'project_name'
stages:
- deploy_to_dokku
deploy_dokku:
@Qurus
Qurus / multi-git.md
Created September 23, 2017 23:04 — forked from rosswd/multi-git-win.md
Setting up a Github and Bitbucket account on the same computer.

Setting up github and bitbucket on the same computer

Github will be the main account and bitbucket the secondary.

Create SSH Keys

ssh-keygen -t rsa -C "github email"

Enter passphrase when prompted. If you see an option to save the passphrase in your keychain, do it for an easier life.

@Qurus
Qurus / file-structure
Created October 16, 2017 13:43 — forked from azat-co/file-structure
Instagram Gallery: A demo app build with Storify API and Node.js http://storify.com/storifydev/instagram-gallery/
- index.js
- package.json
- public/js/main.js
- public/index.html
- css/bootstrap-responsive.min.css
- css/flatly-bootstrap.min.css
@Qurus
Qurus / dokku_add_new_ssh_key.sh
Created February 5, 2018 21:16 — forked from adastreamer/dokku_add_new_ssh_key.sh
Dokku add new ssh key
#!/bin/bash
cat /path/to/public_key | ssh root@yourdokkuinstance "sudo sshcommand acl-add dokku [description]"
@Qurus
Qurus / contributing.md
Last active March 5, 2018 16:59
Contributing

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a