Skip to content

Instantly share code, notes, and snippets.

View Javiani's full-sized avatar

Eduardo Ottaviani Aragão Javiani

View GitHub Profile
@Albert-W
Albert-W / embed gist.md
Last active June 20, 2024 01:33
embed gist in iframe

Embed gist in iframe

it is used to embed gist to an asynchronously-loaded web pages.

<iframe 
    width="100%"
    height="350"    
    src="data:text/html;charset=utf-8,
 
@harmenjanssen
harmenjanssen / index.html
Created May 27, 2019 06:14
Wrap JS-dependent elements in a `<template>`, and simply unwrap at runtime.
<!doctype html>
<title>Hello</title>
<p>The following search field depends on Javascript, so let's render it with Javascript:
<template data-autorender="true">
<form>
<input type="search">
</form>
</template>
@ericelliott
ericelliott / rxjs-patching.js
Created December 10, 2016 00:35
Reduce bundle size with RxJS patching
import { Observable } from 'rxjs/Observable';
// then patch import only needed operators:
import 'rxjs/add/operator/map';
import 'rxjs/add/observable/from';
const foo = Observable.from([1, 2, 3]);
foo.map(x => x * 2).subscribe(n => console.log(n));
@sabaraouf
sabaraouf / mailchimp_subscribe_user.php
Last active January 17, 2016 01:29
MailChimp API - Subscribe User
<?php
$api_key = "YOUR_API_KEY";
$list_id = "YOUR_LIST_ID";
require('Mailchimp.php');
$Mailchimp = new Mailchimp( $api_key );
$Mailchimp_Lists = new Mailchimp_Lists( $Mailchimp );
$subscriber = $Mailchimp_Lists->subscribe( $list_id, array( 'email' => htmlentities($_POST['email']) ) );
if ( ! empty( $subscriber['leid'] ) ) {
@jescalan
jescalan / stylus-plugins.md
Created January 5, 2014 01:20
Stylus Plugin Use

Stylus Plugin Use

This document will briefly review a few of the more common ways of using stylus plugins for those who are not familiar. Throughout these examples, we will be using a non-existant stylus plugin called example. Please change example out for whatever plugin you are actually trying to use!

Standalone/Node

First example is for if you are building your own stylus pipeline in node. This is a pretty standard way to do things.

@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"