Skip to content

Instantly share code, notes, and snippets.

View greenygh0st's full-sized avatar
🏠
Working from home - like a lot of us...

Dale Myszewski greenygh0st

🏠
Working from home - like a lot of us...
View GitHub Profile
@greenygh0st
greenygh0st / ping.py
Last active August 29, 2015 14:13 — forked from pklaus/ping.py
#!/usr/bin/env python2
"""
Other Repositories of python-ping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* https://github.com/l4m3rx/python-ping supports Python2 and Python3
* https://bitbucket.org/delroth/python-ping
@greenygh0st
greenygh0st / fix-homebrew-npm.md
Created December 8, 2015 02:55 — 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

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this:

$ npm update npm -g
@greenygh0st
greenygh0st / GSG case
Created December 11, 2015 14:56 — forked from miek/ GSG case
Unofficial case for YARD Stick One and Ubertooth One from Great Scott Gadgets - http://greatscottgadgets.com/
@greenygh0st
greenygh0st / LinkParser.cs
Created December 13, 2015 06:12
C# helper method for parsing out links and video (Vimeo & YouTube) content
using System;
using System.Text.RegularExpressions;
namespace DalesLab.Helpers
{
public static class Parser
{
public static readonly Regex VimeoVideoRegex = new Regex(@"vimeo\.com/(?:.*#|.*/videos/)?([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Multiline);
public static readonly Regex YoutubeVideoRegex = new Regex(@"youtu(?:\.be|be\.com)/(?:(.*)v(/|=)|(.*/)?)([a-zA-Z0-9-_]+)", RegexOptions.IgnoreCase);
public static readonly Regex HyperlinkRegex = new Regex("http(s)?://([\\w+?\\.\\w+])+([a-zA-Z0-9\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)_\\-\\=\\+\\\\\\/\\?\\.\\:\\;\\'\\,]*)?", RegexOptions.IgnoreCase); //http://weblogs.asp.net/farazshahkhan/regex-to-find-url-within-text-and-make-them-as-link
@greenygh0st
greenygh0st / hashtime.rb
Created January 3, 2016 07:16
A few easy examples for getting hashes out of ruby from various sources
require 'digest'
#A few easy examples for getting hashes out of ruby from various sources
# Get SHA256 Hash of a file
puts Digest::SHA256.hexdigest File.read "data.dat"
# Get MD5 Hash of a file
puts Digest::MD5.hexdigest File.read "data.dat"
# Get MD5 Hash of a string
puts Digest::SHA256.hexdigest "Hello World"
@greenygh0st
greenygh0st / install-comodo-ssl-cert-for-nginx.rst
Created March 18, 2016 18:29 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Generic.Helpers
{
public static class DateTimerGreaterThan
{
/// <summary>
//https://jsfiddle.net/ubgkoghv/
//https://jsfiddle.net/k94d9tL9/1/
var fieldUpdateInProgress = false;
$(".single-value").click(function(){
if (!fieldUpdateInProgress)
{
fieldUpdateInProgress = true;
var origCaller = this;
var origValue = $(origCaller).text();
public sealed class Operation
{
public static readonly Operation Name1 = new Operation("Name1");
public static readonly Operation Name2 = new Operation("Name2");
private Operation(string value)
{
Value = value;
}
@greenygh0st
greenygh0st / filterByProperty.js
Created August 10, 2016 21:03
Filter something in a json array
{{(workParts | filter:{id:part.id})[0].quantity_unit.title}}