Skip to content

Instantly share code, notes, and snippets.

View papagunit's full-sized avatar
👨‍🚀
Don't mind me, just collecting stars...

Devon Guerrero papagunit

👨‍🚀
Don't mind me, just collecting stars...
View GitHub Profile
// Logs all calls to preventDefault / stopPropagation in an user-friendly way
if ( process.env.NODE_ENV !== "production" ) {
(function monkeyPatchEventMethods() {
const logEventMethodCall = (event,methodName) => {
const MinimumMeaninfulSelectors = 3; // how much meaningful items we want in log message
const target = event.target;
const selector = (function computeSelector() {
@duyet
duyet / duyetdev-spark-to-parquet.scala
Created September 21, 2016 03:35
Spark convert CSV to Parquet.
def convert(sqlContext: SQLContext, filename: String, schema: StructType, tablename: String) {
// import text-based table first into a data frame.
// make sure to use com.databricks:spark-csv version 1.3+
// which has consistent treatment of empty strings as nulls.
val df = sqlContext.read
.format("com.databricks.spark.csv")
.schema(schema)
.option("delimiter","|")
.option("nullValue","")
.option("treatEmptyValuesAsNulls","true")

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@markhowellsmead
markhowellsmead / email_not_specific_domain.txt
Last active October 30, 2024 10:39
Regex for valid email address excluding specific free domains, like Gmail, GMX and Yahoo. Extend the list of domains according to your own requirements.
^([\w.-]+)@(\[(\d{1,3}\.){3}|(?!hotmail|gmail|googlemail|yahoo|gmx|ymail|outlook|bluewin|protonmail|t\-online|web\.|online\.|aol\.|live\.)(([a-zA-Z\d-]+\.)+))([a-zA-Z]{2,4}|\d{1,3})(\]?)$

Experimental Docker Libnetwork DHCP Driver

The DHCP driver is intended for users to be able to integrate Docker IP address management with their existing IPAM strategies that use DHCP for dynamic address assignment. DHCP enables users to allocate addresses in an organized fashion that will prevent overlapping IP address assignment by associating a unique MAC address from the container eth0 Ethernet interface to an IP address as determined by the DHCP pools defined in the DHCP configuration.

This driver only provides the DHCP client functionality. It does not include a DHCP server. The default driver offers single-host IPAM or for distributed multi-host orchestrated IPAM see the libnetwork overlay driver.

Getting Started

@parshap
parshap / mdn-search.md
Last active January 24, 2024 17:56
Chrome shortcut to search MDN

mdn Chrome Search Shortcut

Shortcut to perform a Google I'm Feeling Lucky search on https://developer.mozilla.org.

MDN search animation

1. Settings: Manage search engines...

Google Chrome Settings Page

@wvpv
wvpv / sfmc-custom-preference-center-boilerplate.html
Last active July 15, 2024 21:58
SFMC Custom Preference Center Boilerplate
<script runat="server" language="JavaScript">
// src: https://gist.github.com/wvpv/19777e1167d6ac91e2e8
// demo: https://pub.s7.exacttarget.com/yo3hzpktgmu?qs=7145718410d87e2af4e5001112e1de43e2e457b69041ac21&mid=7203368
Platform.Load("core", "1");
var debug = true;
var request = {};
@dhanji
dhanji / gist:8482ddbe3099f7309a9d
Created July 27, 2015 22:02
disposable email domains
"0815.ru0clickemail.com",
"0wnd.net",
"0wnd.org",
"10minutemail.com",
"20minutemail.com",
"2prong.com",
"3d-painting.com",
"4warding.com",
"4warding.net",
"4warding.org",
@JacobLett
JacobLett / gist:2406d715bf15a21e6d17
Last active August 20, 2021 22:09
hubspot embed form validation script - prevent commas, semi-colons, and accent characters
<script charset="utf-8" src="http://js.hsforms.net/forms/current.js"></script>
<script>
hbspt.forms.create({
portalId: '', // Update with default form hubspot form id
formId: '', // Update with default form hubspot form id
//target: '.hubspot',
validationOptions: {
validation: {
@asfaltboy
asfaltboy / css_path.js
Created March 28, 2015 14:19
Get Element CSS Selector
/*
* Copyright (C) 2015 Pavel Savshenko
* Copyright (C) 2011 Google Inc. All rights reserved.
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Matt Lilek <[email protected]>
* Copyright (C) 2009 Joseph Pecoraro
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met: