Skip to content

Instantly share code, notes, and snippets.

@mmuchin
mmuchin / search-git-history.md
Created May 28, 2018 14:31 — forked from lyoshenka/search-git-history.md
Search Git commit history for a string and see the diffs

Searching Git commit history

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

To see the diff of that

@mmuchin
mmuchin / bootstrap-4-sass-mixins-cheat-sheet.scss
Created May 29, 2018 12:35 — forked from anschaef/bootstrap-4-sass-mixins-cheat-sheet.scss
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// @author http://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/v4-dev/scss/mixins
/* -------------------------------------------------------------------------- */
// Grid variables
$grid-columns: 12 !default;
$grid-gutter-width: 30px !default;
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
@mmuchin
mmuchin / e-commerce.md
Created April 14, 2019 17:41 — forked from hjr3/e-commerce.md
Examples of RESTful API calls for E-commerce platforms

Examples of RESTful API calls for E-commerce platforms

These examples are type 3 RESTful API requests and responses. The JSON-HAL specification is used to implement HATEOAS.

Some of the examples are based on my work as architect of the RESTful API at http://www.hautelook.com. All proprietary information has been removed.

Relevant links

@mmuchin
mmuchin / axios-interceptors-refresh-token.js
Created April 30, 2019 11:48 — forked from INQTR/axios-interceptors-refresh-token.js
Axios interceptors token refresh for few async requests. ES6
import axios from 'axios';
import { settings } from '../settings';
import { authAPI } from '.';
const request = axios.create({
baseURL: settings.api_v1,
});
request.interceptors.request.use(
config => {
@mmuchin
mmuchin / FTP-UploadDirectory.ps1
Created May 7, 2019 20:41 — forked from dkittell/FTP-UploadDirectory.ps1
PowerShell – FTP Upload Directory With Sub-Directories
clear
# FTP Server Variables
$FTPHost = 'ftp://192.168.1.1/html/'
$FTPUser = 'user'
$FTPPass = 'password'
#Directory where to find pictures to upload
$UploadFolder = "C:\Temp\"
@mmuchin
mmuchin / api-module.js
Created May 8, 2019 12:48 — forked from d-levin/api-module.js
Reusable Javascript ES6 API module using Axios
import axios from 'axios'
function httpRequest (method, url, request) {
return axios[method](url, request)
.then(response => Promise.resolve(response))
.catch(error => Promise.reject(error))
}
export default {
get (url, request) {
@mmuchin
mmuchin / redis_cheatsheet.bash
Created July 25, 2019 12:02 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@mmuchin
mmuchin / stress.sh
Created October 5, 2019 16:25 — forked from mikepfeiffer/stress.sh
Install Stress Utility on Amazon Linux 2
sudo amazon-linux-extras install epel -y
sudo yum install stress -y
@mmuchin
mmuchin / apache2.sh
Created October 5, 2019 16:25 — forked from mikepfeiffer/apache2.sh
EC2 Bootstrap Script for Apache v2
#!/bin/bash
yum update -y
yum install -y httpd
instanceId=$(curl http://169.254.169.254/latest/meta-data/instance-id)
echo "<h1>Hello World from $instanceId</h1>" > /var/www/html/index.html
systemctl start httpd
systemctl enable httpd