Skip to content

Instantly share code, notes, and snippets.

View 1Marc's full-sized avatar

Marc Grabanski 1Marc

View GitHub Profile
@1Marc
1Marc / gist:11277624
Created April 25, 2014 04:24
Regex keyword filter spec
Keywords here are "SVG" and "CSS3"
The regex should find only words found in the text or in individual keywords in a URL seperated by dashes. It should NOT match any keywords located in shortned URL hashes.
Should match:
"I love this thing about SVG. http://foo.com/article"
"This is awesome http://super-awesome-svg.com"
"I <3 this css3 button thing http://codepen.com/abcdefg"
@1Marc
1Marc / debug_in_context.js
Last active August 29, 2015 14:01
debug a function with an unexpected return value in context
// rename a function in your application
// could be MyApp.someFunction;
var debugging = myFunc;
// override that function
myFunc = function() {
// send the arguments over and call it in context
var result = debugging.apply(this, arguments);
// if we get an unexpected result, then let's open the debugger
if (!result) {
@1Marc
1Marc / workshops-planning.md
Last active January 20, 2023 02:34
Workshop Planning

This gist is no longer in use.

Introduction to Web Development

Schedule for Day 1

Time (CDT) Topic
8:30 Tech Check and Hello
9:00 Your coding toolbox: the Browser and Sublime Text 2/3
9:30 The basics of the web: it’s more than just tubes
10:00 HTML – What is markup, why do we have it, and the DOM
@1Marc
1Marc / display-chat-json.html
Last active August 29, 2015 14:04
Output Chat Log
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chat</title>
<link rel="stylesheet" href="normalize.css">
</head>
<body>
<style>
td {
@1Marc
1Marc / vimeo-raw-file
Created July 27, 2014 01:02
Vimeo Raw File Script
copy('<ul>'
+ '<li><a download href="' + $("#use_your_own_player input:eq(2)").val() + '">Mobile .MP4 file</a> (480×270)</li>'
+ '<li><a download href="' + $("#use_your_own_player input:eq(1)").val() + '">Standard Def .MP4 file</a> (640x360)</li>'
+ '<li><a download href="' + $("#use_your_own_player input:eq(0)").val() + '">High Def .MP4 file</a> (1280x720)</li>'
+ '</ul>')
http://vimeo.com/99210022/download?t=1403810003&v=265672656&s=f423e5f7722fe0702204e25c76fea728
June 2014 - Total minutes: 74252
Section Total Percent
Advanced JavaScript 24893 33.53
JavaScript the Good Parts 7911 10.65
AngularJS In-Depth 6048 8.15
Build Web Apps with Node.js 5497 7.40
JavaScript and jQuery 3838 5.17
jQuery In-Depth 2905 3.91
CSS3 In-Depth 2779 3.74
$blacklisted = array(
'bit.ly',
'job',
'career',
'explodingads',
'botly.info',
'.jp',
'.re',
'cl.ly',
'codecanyon',
<?php
if( ( rcp_is_expired( $user_ID ) || rcp_get_status( $user_ID ) == 'cancelled' ) && rcp_subscription_upgrade_possible( $user_ID ) ) {
echo '<a href="' . esc_url( get_permalink( $rcp_options['registration_page'] ) ) . '" title="' . __( 'Renew your subscription', 'rcp' ) . '" class="rcp_sub_details_renew">' . __( 'Renew your subscription', 'rcp' ) . '</a>';
} elseif( ! rcp_is_active( $user_ID ) && rcp_subscription_upgrade_possible( $user_ID ) ) {
echo '<a href="' . esc_url( get_permalink( $rcp_options['registration_page'] ) ) . '" title="' . __( 'Upgrade your subscription', 'rcp' ) . '" class="rcp_sub_details_renew">' . __( 'Upgrade your subscription', 'rcp' ) . '</a>';
} elseif( rcp_is_active( $user_ID ) && rcp_is_paypal_subscriber() ) {
echo '<a href="https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_manage-paylist" target="_blank" title="' . __( 'Cancel your subscription', 'rcp' ) . '">' . __( 'Cancel your subscription', 'rcp' ) . '</a>';
}
do_action( 'rcp_subscri
@1Marc
1Marc / events.json
Created March 8, 2015 07:44
events
[ { received_at: Sat Feb 21 2015 16:46:44 GMT-0600 (CST),
event_key: '1424553188439e0.6449382344726473',
ip: '95.91.242.56',
country: 'DE',
region: '02',
city: 'Munich',
lat: 48.15,
lon: 11.5833,
org: 'Kabel Deutschland Breitband Services GmbH',
email: 'jasalguero@gmail.com',