Skip to content

Instantly share code, notes, and snippets.

@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 16, 2025 23:25
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).
@hannic
hannic / .wp_wp-cli.sh
Last active December 29, 2017 17:39
wp-cli
# WP-CLI - Commands
wp help <befehl>
# update wordpress installation and its database
wp core update
wp core update-db
# update plugins and themes
wp plugin update --all
wp theme update --all
@nielsutrecht
nielsutrecht / Car.java
Created April 26, 2017 12:25
Simple mockito example
public class Car {
private Engine engine;
private FuelTank fuelTank;
public Car(Engine engine, FuelTank fuelTank) {
this.engine = engine;
this.fuelTank = fuelTank;
}
public void start() {
@ladyada
ladyada / config.txt
Created February 18, 2016 21:57
customized HDMI output
# uncomment if you get no picture on HDMI for a default &quot;safe&quot; mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
@lukas-h
lukas-h / license-badges.md
Last active May 5, 2025 20:19
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@jameselsey
jameselsey / User.java
Created December 23, 2013 12:23
Gist for my spock blog post: http://www.jameselsey.co.uk/blogs/techblog/why-all-java-devs-should-at-least-consider-groovy-and-spock-for-testing Place source files in src/main and run `gradle idea` to create an intelliJ project file
package com.jameselsey.demo.spocktutorial.domain;
public class User {
private int id;
private String name;
private int age;
public int getId() {
return id;
@danfinlay
danfinlay / How to download streaming video.md
Last active April 15, 2025 14:37
How to download a streaming video with Google Chrome

How to download streaming video

Streaming just means a download that they don't want you to keep. But Chrome's developer tools make it easy to access what's really going on under the hood.

Open Developer Tools

From the page where you want to download some things, go into your chrome menu to open the developer tools. You can either:

1.  (On a mac): Command-option-J
2. (On a PC): Control-alt-J
@hannic
hannic / shell_unlock-protected-pdf.md
Last active December 9, 2018 20:29
how to print password-protected pdf files with terminal (mac) #pdf #gs

How to unlock a protectd PDF

You have to get Ghostscript installed first. Run the script, that's it.

#!/bin/sh
# First, type the ghostscript line, second in GS env quit to generate the pdf 
# gs -sOutputFile=Document-unlocked.pdf -sDEVICE=pdfwrite -dNOPAUSE -dbatch -q Document-locked.pdf
# GS>quit()

then unlocked doc gets generated

@mharizanov
mharizanov / WiFiCheck
Created April 6, 2013 08:50
Script to check and re-connect WiFi on Raspberry Pi
#!/bin/bash
##################################################################
# A Project of TNET Services, Inc
#
# Title: WiFi_Check
# Author: Kevin Reed (Dweeber)
# [email protected]
# Project: Raspberry Pi Stuff
#
# Copyright: Copyright (c) 2012 Kevin Reed <[email protected]>
@uarun
uarun / intellij.md
Last active October 16, 2024 12:05
Intellij IDEA - Cheat Sheet (aka useful shortcuts)

Intellij IDEA - Cheat Sheet (aka most useful shortcuts)

Note: Some of these keymapping are specific to IdeaVim plugin. If you don't use IdeaVim (what' wrong with you :)), I've tried to point out where they differ, but I could have missed a few

Coding Session

Parameter documentation for Method Calls

  • Ctrl-P - Popup parameter documentation for method calls