Skip to content

Instantly share code, notes, and snippets.

View NoMan2000's full-sized avatar

Michael Ryan Soileau NoMan2000

  • Surge Forward
  • Reno, Nevada
View GitHub Profile
@ernsheong
ernsheong / access-mac-localhost-from-parallels-desktop-ie-edge.md
Last active January 24, 2024 00:30
Accessing macOS localhost from Parallels Desktop IE or Edge

Access macOS localhost from IE or Edge within Parallels Desktop

This issue is so infuriating that I'm going to take some time to write about it.

  1. MOST IMPORTANT. Your local development server must be bound to IP address 0.0.0.0. Some do this by default, but many don't. You need to make sure that you run your local server with correct IP bindings. You may need to provide additional flags to your serve commands e.g. polymer serve --hostname domain.local, hugo serve --bind 0.0.0.0. If you use a named domain like domain.local, it has to be defined in /etc/hosts and pointing at 0.0.0.0.

  2. My Parallels setting is using Shared Network, nothing special there.

  3. Open macOS Terminal and type ifconfig. Look for the value under vnic0 > inet. It is typically 10.211.55.2.

@develar
develar / appveyor.yml
Created September 29, 2017 05:34
Sample appveyor.yml to Build Electron App for Windows
image: Visual Studio 2017
platform:
- x64
cache:
- node_modules
- '%USERPROFILE%\.electron'
init:
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* 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 😨
@aswad32
aswad32 / ElasticSearch5-Kibana-xpack
Created November 15, 2016 23:09
Installing ElasticSearch 5.0.0, Kibana 5.0.1 and X-Pack with Homebrew
#install elasticsearch (this will install elasticsearch as a services and automatically start after installation done)
brew install elasticsearch
#install x-pack plugin for elasticsearch
elasticsearch-plugin install x-pack
#download kibana from https://www.elastic.co/products/kibana
copy the archive to some where that can easily accessible
#install x-pack for kibana (change directory to kibana bin directory)
@fogartyp
fogartyp / JavaPkg.build
Last active December 10, 2015 16:56
Creating a custom Java Runner on C9 IDE
// Create a custom Cloud9 build system - similar to the Sublime build system
// For more information see https://docs.c9.io/custom_runners.html
{
"cmd": [
"bash",
"-c",
"mkdir -p $(echo $file | sed -r \"s_/src/.*_/_g\")bin; find $(echo $file | sed -r \"s_/src/.*_/_g\")src -name '*.java' -print | xargs javac -sourcepath $(echo $file | sed -r \"s_/src/.*_/_g\")src -d \"$(echo $file | sed -r \"s_/src/.*_/_g\")bin\""
],
"info": "\\033[01;34mBuilding\\033[00m \\033[01;31m$project_name\\033[00m",
"selector": "source.java",
@NoMan2000
NoMan2000 / files.sh
Last active October 24, 2015 01:26
Change Permissions on Unix to 775 for directories and 664 for files
sudo find . -type f | xargs chmod -v 664
sudo find . -type d | xargs chmod -v 775
sudo chmod -R u=rwX,g=rwX,o=rX .
sudo chown -R ubuntu:www-data .
@vitorbritto
vitorbritto / rm_mysql.md
Last active May 7, 2024 09:59
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@mageekguy
mageekguy / gist:29cdf2e52d1c507f25b3
Last active October 24, 2015 22:33
Mysqli and generator are in a boat...
<?php
namespace db;
class client
{
private
$user,
$password,
$host,
@asyncanup
asyncanup / simple-javascript-assert.md
Last active May 11, 2022 01:03
Simple JavaScript assert

Why you need assertions

It's better to fail with your own error than undefined is not a function.

A simple assertion solution would let your application fail early and fail at the right point in runtime execution. Allowing you to handle it better.

How you write assertions