Skip to content

Instantly share code, notes, and snippets.

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 5, 2024 19:57
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@cweagans
cweagans / Vagrantfile
Last active June 8, 2018 20:46
Vagrantfile
# Up to date version can always be found at https://gist.github.com/cweagans/4e879a72985905e145df
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.synced_folder ".", "/srv", type: "nfs"
config.vm.network "private_network", ip: "192.168.205.142"
config.vm.network "forwarded_port", guest: 80, host: 8085
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
@font-face {
font-family: 'EntypoRegular';
src: url('font/entypo.eot');
src: url('font/entypo.eot?#iefix') format('embedded-opentype'),
url('font/entypo.woff') format('woff'),
url('font/entypo.ttf') format('truetype'),
url('font/entypo.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
@crittermike
crittermike / gist:3503791
Last active February 2, 2019 20:11
Import gzipped MySQL DB dump but ignore data from specific tables
# REGULAR VERSION
gunzip -c db.sql.gz | grep -Ev "^INSERT INTO \`(cache_|search_|sessions|whatever)" | mysql -u root -p databasename
# DRUPAL VERSION
gunzip -c db.sql.gz | grep -Ev "^INSERT INTO \`(cache_|search_|sessions|whatever)" | drush sqlc
@crofty
crofty / index.html
Last active October 22, 2021 08:24
A example of using Google Map tiles with the Leaflet mapping library - http://matchingnotes.com/using-google-map-tiles-with-leaflet
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script>
</head>
<body>