This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Markdown Preview in txti | |
// @namespace https://gist.github.com/AeonFr/f44a8b6f175d059f8328638a6a30ce4d | |
// @version 0.1 | |
// @description When EDITING a txti (txti.es/*/edit) in txti.es you should be able to preview your changes (a toggle preview button appears) | |
// @author Francisco Cano | |
// @match http://txti.es/*/edit | |
// @grant none | |
// @run-at document-end | |
// @require https://cdnjs.cloudflare.com/ajax/libs/showdown/1.3.0/showdown.min.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM DATE 2016 | |
PERFORMER "Juan Ingaramo" | |
TITLE "Músico" | |
FILE "MusicoJuanIngaramo.mp3" MP3 | |
TRACK 01 AUDIO | |
TITLE "Soltar" | |
INDEX 01 00:00:00 | |
TRACK 02 AUDIO | |
TITLE "Comodín" | |
INDEX 01 04:07:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function calculateTotalOffsetTop (elem, total){ | |
total = total || 0; | |
total = elem.offsetTop + total; | |
if (elem.offsetParent) return calculateTotalOffsetTop(elem.offsetParent, total) | |
else return total; | |
} | |
function calculateTotalOffsetLeft (elem, total){ | |
total = total || 0; | |
total = elem.offsetLeft + total; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- facebook open graph & google tags (this also works for twitter) --> | |
<!-- This are usefull mostly for machines. --> | |
<meta property="og:url" content="https:{{ .Permalink }}" /> | |
<!-- es_AR means "spanish from Argentina". Not really supported, though. That's why there's a fallback --> | |
<meta property="og:locale" content="es_AR" /> | |
<meta property="og:locale:alternate" content="es_LA" /> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* el(tag, options[, innerHTML]) | |
* Creates an HTMLElement object | |
* and fills it with various attributes and properties. | |
* Inspired by React's `React.createElement()` function | |
* | |
* @param string tag The element's tagname, such as P, DIV, etc. | |
* @param object options | |
* An object that can contain key-value pairs of attributes such as | |
* "aria-label", "itemtype", "disabled", etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div ref="element" v-html="text"></div> | |
</template> | |
<script> | |
import MediumEditor from 'medium-editor' | |
// impure helper function, replaces some element from the dom with a new one of the given tag name | |
// returns the new one. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Returns the contents of $stm (PDO Statement) | |
// as an associative array, with correct native types | |
// for integers, nulls, and floats | |
$array = []; | |
while ($fila = $stm->fetch(\PDO::FETCH_ASSOC)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Usage: ./git-diff {commit_id_or_tag_name_or_branch_name} | |
git --no-pager diff --compact-summary --stat=255 --diff-algorithm=minimal --name-status %1 HEAD >> diff.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url(https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i,900,900i);@font-face{font-family:filmin;src:url(../fonts/filmin-custom/big/filmin-big.eot);src:url(../fonts/filmin-custom/big/filmin-big.eot?#iefix) format("embedded-opentype"),url(../fonts/filmin-custom/big/filmin-big.woff) format("woff"),url(../fonts/filmin-custom/big/filmin-big.ttf) format("truetype"),url(../fonts/filmin-custom/big/filmin-big.svg#filmin) format("svg");font-weight:400;font-style:normal}@font-face{font-family:filmin-small;src:url(../fonts/filmin-custom/small/filmin-small.eot);src:url(../fonts/filmin-custom/small/filmin-small.eot?#iefix) format("embedded-opentype"),url(../fonts/filmin-custom/small/filmin-small.woff) format("woff"),url(../fonts/filmin-custom/small/filmin-small.ttf) format("truetype"),url(../fonts/filmin-custom/small/filmin-small.svg#filmin) format("svg");font-weight:400;font-style:normal}@-webkit-keyframes spinner{0%{transform:scale(.5) rotate(0deg)}to{transform:scale(.5) rotate(1turn)}}@keyf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const defaultLocale = "default"; // falls back to user's locale using the string "default" | |
const getMonthName = (date, { locale = defaultLocale, format = "long" }) => { | |
let result = date.toLocaleString(locale, { | |
month: format, | |
}); | |
// Fix for ES: make first letter uppercase and remove trailing "." | |
return result.slice(0, 1).toUpperCase() + result.slice(1).replace(/\.$/, ""); | |
}; |
OlderNewer