Skip to content

Instantly share code, notes, and snippets.

@paulcuth
paulcuth / tfl-tube-data.json
Created July 28, 2011 09:47
TfL tube line & station data in JSON format.
var lines = {
B: 'Bakerloo',
C: 'Central',
D: 'District',
H: 'Hammersmith & Circle',
J: 'Jubilee',
M: 'Metropolitan',
N: 'Northern',
P: 'Piccadilly',
@chrisl8888
chrisl8888 / media-queries.scss
Last active February 13, 2025 18:43
All Media Queries breakpoints
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
@steveosoule
steveosoule / add-rules-stylesheets-with-javascript.js
Created July 8, 2013 22:12
Add Rules to Stylesheets with JavaScript
// Add Rules to Stylesheets with JavaScript
// http://davidwalsh.name/add-rules-stylesheets
/* Getting the Stylesheet
Which stylesheet you add the rules to is up to you. If you have a specific stylesheet in mind, you can add an ID to the LINK or STYLE element within your page HTML and get the CSSStyleSheet object by referencing the element's sheet property. The stylesheets can be found in the document.styleSheets object:*/
var sheets = document.styleSheets; // returns an Array-like StyleSheetList
/*
Returns:
@onyxfish
onyxfish / README.md
Last active May 6, 2025 21:05
Google Spreadsheets script to generate slugs from a range of cells

This script for Google Spreadsheets allows you to generate slugs for your data such as might be used for creating unique urls.

Use it like this!

# A B C
1 a b slug
2 foo baz bing =slugify(A2:B4)
3 bar BAZ
4 FOO baz-bing
@stakes
stakes / frameless.coffee
Last active April 14, 2017 21:08
Framer.js module to open prototypes in Frameless
# Add the following line to your project in Framer Studio.
# `frameless = require "frameless"`
frameless = {}
# Directly opens the prototype in Frameless
frameless.open = ->
intent = "frameless://"
url = intent + window.location.host + window.location.pathname + "/"
window.location.replace url
@woeldiche
woeldiche / framerproject.coffee
Created June 3, 2015 11:41
Modular Framer project
# Import layers
Imports = Framer.Importer.load "imported/Nordea Markets Master"
# Import settings and model
config = require("nmSettings").config;
model = require("nmModel").model;
# Import page changing behavior
slideIn = require("nmSlidein");
# Import instances of pages
TradeInstance = require("nmTrade");
@inversion
inversion / gist:60a96ea3294e4ce35615
Last active November 30, 2015 21:18
TfL Hex Line Colours JSON
{
"Bakerloo": "#B36305",
"Central": "#E32017",
"Circle": "#FFD300",
"District": "#00782A",
"DLR": "#00A4A7",
"Hammersmith and City": "#F3A9BB",
"Jubilee": "#A0A5A9",
"Metropolitan": "#9B0056",
"Northern": "#000000",
@RayPS
RayPS / Framer-CSS-Spiner.coffee
Last active September 26, 2016 17:07
Framer CSS Spiner
spiner = new Layer
borderRadius: "50%"
backgroundColor: false
spiner.style["border"] = "5px solid"
spiner.style["border-color"] = "white white transparent transparent"
spiner.center()
spiner.animate
@monicao
monicao / react.md
Last active February 23, 2021 19:07
React Lifecycle Cheatsheet

React Component Lifecycle

  • getInitialState
  • getDefaultProps
  • componentWillMount
  • componentDidMount
  • shouldComponentUpdate (Update only)
  • componentWillUpdate (Update only)
  • componentWillReceiveProps (Update only)
  • render
@mmazzarolo
mmazzarolo / hideOnScroll.js
Last active July 4, 2024 12:57
react-native-action-button hide on scroll
// 1. Define a state variable for showing/hiding the action-button
state = {
isActionButtonVisible: true
}
// 2. Define a variable that will keep track of the current scroll position
_listViewOffset = 0
// 3. Add an onScroll listener to your listview/scrollview
<ListView