Skip to content

Instantly share code, notes, and snippets.

View christianhaller's full-sized avatar

Christian Haller christianhaller

View GitHub Profile
@christianhaller
christianhaller / input.scss
Created January 26, 2022 09:07
Generated by SassMeister.com.
/*
change the sass compiler from dart-sass to libsass,
retrigger compiling and
see the missing selector in the right window
*/
%placeholder {
@christianhaller
christianhaller / upload-to-s3.js
Created December 6, 2020 13:00
Upload files to S3 and invalidate CF
const { S3, CloudFront } = require("aws-sdk");
const { promises } = require("fs");
const globby = require("globby");
const { lookup } = require("mime-types");
const { extname, join } = require("path");
(async () => {
const files = await globby("*", { cwd: "dist" });
const Bucket = "www.fabiangroher.de";
const DistributionId = "EL7ZW9DN9Q7WC";
<script type="text/javascript">
<!--\\
(function(){var a='article';var b={"article":"20","gallery":"10"};
if(typeof(a)!='undefined'){if(b[a]){var ref=document.referrer;if(ref.match(/^(https|http)?:\/\/([^\/]+\.)?(facebook\.com|twitter\.com|t\.co|bitly\.com|bit\.ly|xrow\.com)(\/|$)/i)){window.location.href='/paidcontent/metered'+window.location.pathname;}}}}());
//-->
</script>
@christianhaller
christianhaller / old school
Created June 10, 2013 14:13
before javascript was cool!
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)