Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
| public abstract class CaffeineBeverage { | |
| void prepareRecipe() { | |
| boilWater(); | |
| brew(); | |
| pourInCup(); | |
| if (customerWantsCondiments()) | |
| addCondiments(); | |
| } | |
| abstract void brew(); |
| public interface Subject { | |
| public void registerObserver(Observer o); | |
| public void removeObserver(Observer o); | |
| public void notifyObservers(); | |
| } | |
| public interface Observer { | |
| public void update(float temp, float humidity, float pressure); | |
| } |
| public interface FlyBehavior { | |
| public void fly(); | |
| } | |
| public interface QuackBehavior { | |
| public void quack(); | |
| } | |
| public class FlyWithWings implements FlyBehavior { | |
| public void fly() { System.out.println("flying!"); } |
| public class Singleton { | |
| private Singleton() {} | |
| private static class SingletonHolder { | |
| private static final Singleton uniqueInstance = new Singleton(); | |
| } | |
| public static Singleton getInstance() { | |
| return SingletonHolder.uniqueInstance; | |
| } |
| // ingredients: dough, sauce | |
| public interface Dough {}; | |
| public interface Cheese {}; | |
| public interface Pepperoni {}; | |
| public class ThinCrustDough implements Dough { | |
| public String toString() { return "This Crust Dough"; } | |
| } | |
| public class ParmesanCheese implements Cheese { |
| public class Switch { | |
| private Engine engine; | |
| private boolean on; | |
| public Switch(Engine engine) { | |
| this.engine = engine; | |
| this.on = false; | |
| } | |
| public boolean switchOn() { |
| create table countries (country_code char(2) primary key, country name text unique); |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns | |
| Compress 1K bytes with Zippy 3,000 ns | |
| Send 2K bytes over 1 Gbps network 20,000 ns | |
| Read 1 MB sequentially from memory 250,000 ns | |
| Round trip within same datacenter 500,000 ns | |
| Disk seek 10,000,000 ns |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
| import logging | |
| def foo(): | |
| logging.debug('Dump debug message') | |
| logging.info('Dump info message') | |
| logging.warn('Dump warn message') | |
| logging.error('Dump error message') | |
| logging.critical('Dump critical message') |