Skip to content

Instantly share code, notes, and snippets.

View markthomas93's full-sized avatar

Mark Thomas markthomas93

  • freelance
  • California
View GitHub Profile
@markthomas93
markthomas93 / curl.md
Created February 16, 2019 15:43 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@markthomas93
markthomas93 / prettyCss.sh
Created February 16, 2019 15:48 — forked from eyecatchup/prettyCss.sh
Bash script to "pretty-print" minified CSS.
#!/bin/bash
#Author: Stephan Schmitz, https://github.com/eyecatchup, <eyecatchup@gmail.com>
#Based on work by: Michael Bianco, http://developer.mabwebdesign.com/, <software@mabwebdesign.com>
#Description: Bash script to create a pretty-printed version of a minified CSS file.
# Note: Requires GNU sed. See: http://www.gnu.org/software/sed//sed.html
#Usage: prettyCss.sh inputfile [outputfile]
# If [outputfile] is not given, pretty-printed CSS will be send to stdout.
SED_COMMAND=/bin/sed # NOTE: Change the SED_COMMAND variable value to the path to your GNU sed!
$ curl --help
Usage: curl [options...] <url>
Options: (H) means HTTP/HTTPS only, (F) means FTP only
--anyauth Pick "any" authentication method (H)
-a, --append Append to target file when uploading (F/SFTP)
--basic Use HTTP Basic Authentication (H)
--cacert FILE CA certificate to verify peer against (SSL)
--capath DIR CA directory to verify peer against (SSL)
-E, --cert CERT[:PASSWD] Client certificate file and password (SSL)
--cert-status Verify the status of the server certificate (SSL)
@markthomas93
markthomas93 / .hyper.js
Created February 28, 2019 21:56 — forked from zenorocha/.hyper.js
Setup macOS Sierra (10.12)
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
@markthomas93
markthomas93 / getEmberComponentInstance.js
Created March 1, 2019 20:41 — forked from ngyv/getEmberComponentInstance.js
Snippet to get the component instance on console for Ember
let component = App.__container__.lookup('-view-registry:main')[componentId]; // componentId i.e. "ember4322"
@markthomas93
markthomas93 / background.js
Created March 1, 2019 22:50 — forked from danharper/background.js
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@markthomas93
markthomas93 / 1-setup.md
Created March 31, 2019 22:49 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.

@markthomas93
markthomas93 / chrome.md
Created April 1, 2019 19:54 — forked from 0xjjpa/chrome.md
Understanding Google Chrome Extensions

#Introduction

Developing Chrome Extensions is REALLY fun if you are a Front End engineer. If you, however, struggle with visualizing the architecture of an application, then developing a Chrome Extension is going to bite your butt multiple times due the amount of excessive components the extension works with. Here are some pointers in how to start, what problems I encounter and how to avoid them.

Note: I'm not covering chrome package apps, which although similar, work in a different way. I also won't cover the page options api neither the new brand event pages. What I explain covers most basic chrome applications and should be enough to get you started.

Table of Contents

  1. Understand the Chrome Architecture
  2. Understand the Tabs-Extension Relationship
  3. Picking the right interface for the job
@markthomas93
markthomas93 / array.return.unique.values.only.js
Last active April 4, 2019 03:29 — forked from telekosmos/uniq.js
Remove duplicates from js array (ES5/ES6)
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
});
};
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
});
@markthomas93
markthomas93 / purgeAndroid.txt
Created June 25, 2019 08:45 — forked from tahmidsadik/purgeAndroid.txt
How to completely remove Android Studio from Mac OS X
How to Completely Remove Android Studio
Execute these commands from the terminal
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*