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
async function getQuote() { | |
let response = await fetch( | |
"https://api.chucknorris.io/jokes/random" | |
); | |
let data = await response.json(); | |
return data; | |
} | |
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
#!/usr/bin/python3 | |
# Utility to remove (in fact, resize) the white rectangle that browsers add to any pdf generated via print method | |
# Usage : | |
# python removebg.py browser_generated_file.pdf | |
# Depends on QPDF https://qpdf.readthedocs.io/ | |
# https://tex.stackexchange.com/questions/50069/how-to-change-white-background-of-an-included-pdf-to-transparent |
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
#!/usr/bin/python3 | |
# https://tex.stackexchange.com/questions/50069/how-to-change-white-background-of-an-included-pdf-to-transparent | |
# use : | |
# python3 removebg.py filewithbackground.pdf | |
# the script is not smart at all : it resizes every “full page” element that is a background | |
import os | |
import sys |
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
class FluxFixer extends Paged.Handler { | |
constructor(chunker, polisher, caller) { | |
super(chunker, polisher, caller); | |
this.styleSheet = polisher.styleSheet; | |
this.fluxRules = []; | |
// this.fluxRulesSelectors = []; | |
// this.fluxRulesStyles = []; | |
} | |
onRule(ruleNode){ |
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
#!/usr/bin/python3 | |
#-*- coding: utf-8 -*- | |
# imports | |
import random | |
with open('vars.css', 'w') as f: | |
for i in range(90): | |
for j in range(6): | |
wdth = random.randint(0, 1000) |
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 | |
/* | |
input : <p>« L’apostrophe.</p> | |
output: <p><span class="first-char">« </span><span class="first-letter">L’</span>apostrophe.</p> | |
*/ | |
function dropCap($p){ | |
$search = '^<p>([\W]*)([\w])([’]?)(.+)*<\/p>'; | |
$replacement = '<p><span class="first-char">\\1</span><span class="first-letter">\\2\\3</span>\\4</p>'; | |
$new = mb_ereg_replace( $search, $replacement, $p); | |
return $new; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>GAME</title> | |
<style type="text/css"> | |
* { margin:0; padding: 0;} |
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
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" | |
codebase="http://www.apple.com/qtactivex/qtplugin.cab" | |
width="200" height="16"> | |
<param name="src" value="movie.mov" /> | |
<param name="autoplay" value="true" /> | |
<param name="pluginspage" value="http://www.apple.com/quicktime/download/" /> | |
<param name="controller" value="true" /> | |
<!--[if !IE]> <--> | |
<object data="movie.mov" width="200" height="16" type="video/quicktime"> | |
<param name="pluginurl" value="http://www.apple.com/quicktime/download/" /> |
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
<video width="640" height="360" controls="controls"> | |
<source src="__VIDEO__.MP4" type="video/mp4" /> | |
<source src="__VIDEO__.OGV" type="video/ogg" /> | |
<object width="640" height="360" type="application/x-shockwave-flash" data="__FLASH__.SWF"> | |
<param name="movie" value="__FLASH__.SWF" /> | |
<param name="wmode" value="transparent" /> | |
<param name="flashvars" value="controlbar=over&image=__POSTER__.JPG&file=__VIDEO__.MP4" /> | |
<img src="__VIDEO__.JPG" width="640" height="360" alt="__TITLE__" title="No video…" /> | |
</object> | |
</video> |
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
<iframe src="http://player.vimeo.com/video/8981918?title=0&byline=0&portrait=0&badge=0&color=ffffff&autoplay=true&loop=true&control=false"></iframe> | |
<div id="container">—</div> |