Skip to content

Instantly share code, notes, and snippets.

View Sitebase's full-sized avatar
🤘

Wim Mostmans Sitebase

🤘
View GitHub Profile
@Sitebase
Sitebase / index.html
Last active August 29, 2015 14:20
Facebook share test
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Meta description example" />
<meta name="author" content="Coca" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@Sitebase
Sitebase / data.json
Last active September 4, 2019 01:51
Lambda auto transcode
{
"Records": [
{
"eventVersion": "2.0",
"eventSource": "aws:s3",
"awsRegion": "us-east-1",
"eventTime": "1970-01-01T00:00:00.000Z",
"eventName": "ObjectCreated:Put",
"userIdentity": {
"principalId": "EXAMPLE"
@Sitebase
Sitebase / template.html
Created March 19, 2015 15:19
Quote template
<link href='http://fonts.googleapis.com/css?family=Lora' rel='stylesheet' type='text/css'>
<style>
body{
/* defaults, use for testing the template without PhantomJS */
width: 400px;
height: 400px;
background-color: #2e3192;
font-size: 400px;
@Sitebase
Sitebase / template.html
Created March 19, 2015 15:18
Twitter tegel template
<link href='http://fonts.googleapis.com/css?family=Coming+Soon' rel='stylesheet' type='text/css'>
<style>
* {
box-sizing: border-box;
}
body{
/* defaults, use for testing the template without PhantomJS */
width: 400px;
height: 400px;
font-size: 400px;
@Sitebase
Sitebase / gist:8da8495981672a23daa3
Created February 19, 2015 10:00
I think we all can agree that the focus outlines are ugly and in most cases destroy the visual aspect of elements. With this snippet you can set the outline to none and still give the user some feedback about where on the page the focus is. For an example of this take a look at the first button in this screenshot https://www.dropbox.com/s/bl3x74…
*:focus:before {
content: "⇥";
position: absolute;
font-size: 0.8em;
left: 5px;
top: -30%;
}
@Sitebase
Sitebase / heroku.js
Created February 12, 2015 22:30
Detect if node app is running on Heroku
function isHeroku()
{
return process.env.NODE && ~process.env.NODE.indexOf("heroku") ? true : false;
}
@Sitebase
Sitebase / server.js
Created February 4, 2015 08:51
Force https in express
var app = express();
...
app.use(function(req, res, next) {
if (req.headers['x-forwarded-proto'] === 'https') {
next(); // already on https so just continue
else
res.redirect('https://' + req.headers.host + req.url); // redirect to https
});
@Sitebase
Sitebase / gist:355fc595129862cb245f
Created February 3, 2015 13:00
Example ambassador tracking script
<script>
(function(i,s,o,g,r,a,m){i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)};
a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=a.defer=1;a.src=g;
m.parentNode.insertBefore(a,m)})(window,document,'script','//api.bubobox.com/tracker.js','_bbq');
_bbq('init', { user_id: 1, segment: 'website' });
</script>
@Sitebase
Sitebase / bbbx-reorder-stack-script.js
Created January 12, 2015 14:42
Reorder BuboBox stack items
var bbbx_stack_presets = {
'overlay' : {
modules: [
'pre',
'terms.pre',
'terms',
'terms.post',
'overlay.pre',
'overlay',
'overlay.post',
@Sitebase
Sitebase / deltag.sh
Created January 9, 2015 08:35
Batch git tag delete locally and remote
# replace "release-" on the following line with the string you want to search for
# or remove the "| grep release-" part to remove all local and remote tags
for t in `git tag | grep release-`
do
echo "delete $t"
git push origin :$t # Delete remote
git tag -d $t # Delete local
done