Skip to content

Instantly share code, notes, and snippets.

@ntamvl
ntamvl / install-multiple-jdk-on-macos-high-sierra.md
Last active February 21, 2024 11:12
Install Multiple Java Versions on macOS High Sierra

Install Multiple Java Versions on macOS High Sierra

Install Homebrew Cask

On Mac, Homebrew is the de-facto package manager, and Homebrew Cask is the app manager. I’m going to use Cask to install Java 7 and 8.

Install Homebrew Cask first if you haven’t:

brew update
brew tap caskroom/cask
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active April 21, 2024 22:10
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@boneskull
boneskull / README.md
Last active June 24, 2023 13:42
syntax highlighting for Vagrantfile in non-RubyMine JetBrains IDEs
  1. Add this file to /path/to/prefs/filetypes/
  2. Restart IDE

This page will help you find the correct directory.

@nadar
nadar / PostMessageToSlackChannel.php
Last active April 19, 2024 13:44
Post a message to a slack channel with PHP
<?php
/**
* Send a Message to a Slack Channel.
*
* In order to get the API Token visit:
*
* 1.) Create an APP -> https://api.slack.com/apps/
* 2.) See menu entry "Install App"
* 3.) Use the "Bot User OAuth Token"
@sheharyarn
sheharyarn / YoutubeDownloader.md
Last active October 15, 2022 06:26
Download Videos from Youtube in (Ruby || PHP)

Youtube Downloaders

Download Youtube Videos using Ruby or PHP

Just copy the appropriate script, provide the video_id and run. It will list download links for different qualities and streams.

:P

@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active April 19, 2024 01:50
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@msurguy
msurguy / eloquent.md
Last active February 8, 2022 03:13
Laravel 4 Eloquent Cheat Sheet.

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

@BlakeGardner
BlakeGardner / install nano.sh
Last active April 23, 2024 20:22
Syntax highlighting in nano on Mac OS
# Last updated March, 2022 for Apple silicon Macs
# Install Homebrew if you don't already have it: https://brew.sh
# install nano from homebrew
brew install nano nanorc
# update your nanorc file
echo 'include "/opt/homebrew/share/nanorc/*.nanorc"' >> ~/.nanorc
# close and re-open your terminal and you'll have syntax highlighting
@chipotle
chipotle / deploy.rb
Last active February 8, 2018 18:54
Capistrano deployment script for Laravel 4
# Capistrano Laravel 4 Deployment Tasks
# Watts Martin (layotl at gmail com)
# https://gist.github.com/chipotle/5506641
# updated 14-Aug-2013
# Assumptions:
#
# - You are using a .gitignore similar to Laravel's default, so your
# vendor directory and composer(.phar) are *not* under version control
# - Composer is installed as an executable at /usr/local/bin/composer