Skip to content

Instantly share code, notes, and snippets.

View jamiewilson's full-sized avatar

Jamie Wilson jamiewilson

View GitHub Profile
@irae
irae / _Stay_standalone.md
Last active January 29, 2024 12:38 — forked from kylebarrow/example.html
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.

@mhawksey
mhawksey / gist:1276293
Last active October 23, 2023 09:00
Google App Script to insert data to a google spreadsheet via POST or GET - updated version as per https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@barnes7td
barnes7td / sublime_setup.md
Last active March 28, 2024 17:59
Sublime Terminal Setup

Setup Terminal for Sublime Shorcut "subl":

Open terminal and type:

1. Create a directory at ~/bin:

mkdir ~/bin

2. Copy sublime executable to your ~/bin directory:

@willurd
willurd / web-servers.md
Last active May 19, 2024 20:19
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@yankeyhotel
yankeyhotel / CSS Triangle Less Mixin
Last active August 29, 2015 14:01
CSS Triangle Less Mixin
.css-triangle(@triangle-size, @triangle-color, @triangle-direction) {
border: inset @triangle-size;
content: "";
display: block;
height: 0;
position: absolute;
width: 0;
& when (@triangle-direction = top) {
border-color: transparent transparent @triangle-color transparent;
@yankeyhotel
yankeyhotel / Background Cover Less Mixin
Last active August 29, 2015 14:01
Background Cover Less Mixin
.background-cover(@url, @position) {
background-image: url(@url);
background-position: center @position;
-moz-background-size: cover;
background-size: cover;
background-repeat: no-repeat;
}
@yankeyhotel
yankeyhotel / Font-size rem Calculator Less Mixin
Created May 27, 2014 19:23
Font-size rem Calculator Less Mixin
.rem-calc(@sizeValue) {
@remValue: @sizeValue/10;
@pxValue: @sizeValue;
font-size: ~"@{pxValue}px";
font-size: ~"@{remValue}rem";
}
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@barnaby
barnaby / gulpfile.js
Last active April 17, 2022 12:45
Takana and gulp.js playing nice
var gulp = require('gulp'),
takana = require('takana');
gulp.task('takana', function() {
takana.run({
path: __dirname,
includePaths: [] // Optional
});
});
if(Meteor.isServer()) {
Meteor.methods({
postTweet: function() {
Twitter = new TwitMaker({
consumer_key: Meteor.settings.twitterKey,
consumer_secret: Meteor.settings.twitterSecret,
access_token: Meteor.user().services.twitter.accessToken,
access_token_secret: Meteor.user().services.twitter.accessTokenSecret