Skip to content

Instantly share code, notes, and snippets.

@linktoming
linktoming / 50-system-apple.quirks
Created August 28, 2021 03:12 — forked from imabuddha/50-system-apple.quirks
Apple Magic Trackpad 2 configuration for Raspberry Pi (& linux generally) — Properly configures the pressure sensitivity, natural scrolling, and the left/right/middle (1/2/3 finger) clicks.
# add this to /usr/share/libinput/50-system-apple.quirks (create if doesn't exist)
[Apple Magic Trackpad v2]
MatchName=*Magic Trackpad 2
AttrSizeHint=162x115
AttrTouchSizeRange=20:10
AttrPressureRange=2:0
AttrPalmSizeThreshold=900
AttrThumbSizeThreshold=700
@linktoming
linktoming / private_fork.md
Created August 26, 2021 08:36 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@linktoming
linktoming / Functional Core, Imperative Shell
Last active June 6, 2016 15:28 — forked from jhrr/Functional Core, Imperative Shell
Notes and links for ideas about Gary Bernhardt's "functional core, imperative shell"
http://www.infoq.com/presentations/Simple-Made-Easy
http://www.infoq.com/presentations/integration-tests-scam
http://blog.thecodewhisperer.com/2010/09/14/when-is-it-safe-to-introduce-test-doubles
http://youtu.be/yTkzNHF6rMs
http://pyvideo.org/video/1670/boundaries
http://skillsmatter.com/podcast/ajax-ria/enumerators
http://alistair.cockburn.us/Hexagonal+architecture
http://c2.com/cgi/wiki?PortsAndAdaptersArchitecture
http://www.confreaks.com/videos/977-goruco2012-hexagonal-rails
http://www.confreaks.com/videos/1255-rockymtnruby2012-to-mock-or-not-to-mock
@linktoming
linktoming / Communicator.h
Created February 1, 2016 08:51 — forked from rjungemann/Communicator.h
How to open a TCP socket in Objective-C
#import <Foundation/Foundation.h>
@interface Communicator : NSObject <NSStreamDelegate> {
@public
NSString *host;
int port;
}
- (void)setup;
@linktoming
linktoming / KeyboardHandler.m
Last active August 29, 2015 14:14 — forked from philipmcdermott/KeyboardHandler.m
How to use keyboard notification to adjust view when keyboard is about to show or hide
- (void)viewDidAppear:(BOOL) animated {
[super viewDidAppear:animated];
// Register notification when the keyboard will be show
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
// Register notification when the keyboard will be hide

UIStatusBarStyle in iOS 7

  • The status bar in iOS 7 is transparent, the view behind it shows through.

  • The style of the status bar refers to the appearances of its content. In iOS 7, the status bar content is either dark (UIStatusBarStyleDefault) or light (UIStatusBarStyleLightContent). Both UIStatusBarStyleBlackTranslucent and UIStatusBarStyleBlackOpaque are deprecated in iOS 7.0. Use UIStatusBarStyleLightContent instead.

How to change UIStatusBarStyle

  • If below the status bar is a navigation bar, the status bar style will be adjusted to match the navigation bar style (UINavigationBar.barStyle):
#!/bin/bash
# NOTE: this is an OSX launchd wrapper shell script for Tomcat (to be placed in $CATALINA_HOME/bin)
# remember to run chmod +x on it
CATALINA_HOME=/Users/username/tomcat
function shutdown() {
date
echo "Shutting down Tomcat"
#!/bin/sh
# Script for managing build and version numbers using git and agvtool.
# Change log:
# v1.0 18-Jul-11 First public release.
# v1.1 29-Sep-12 Launch git, agvtool via xcrun.
version() {

This is a post by Joel Spolsky. The original post is linked at the bottom.

This is such a common question here and elsewhere that I will attempt to write the world's most canonical answer to this question. Hopefully in the future when someone on answers.onstartups asks how to split up the ownership of their new company, you can simply point to this answer.

The most important principle: Fairness, and the perception of fairness, is much more valuable than owning a large stake. Almost everything that can go wrong in a startup will go wrong, and one of the biggest things that can go wrong is huge, angry, shouting matches between the founders as to who worked harder, who owns more, whose idea was it anyway, etc. That is why I would always rather split a new company 50-50 with a friend than insist on owning 60% because "it was my idea," or because "I was more experienced" or anything else. Why? Because if I split the company 60-40, the company is going to fail when we argue ourselves to death. And if you ju

# STEP 1: VERIFY THAT YOU DO NOT ALREADY HAVE POSTGRESQL INSTALLED ON YOUR SYSTEM
ps ax | grep postgres
# STEP 2: INSTALL POSTGRESQL ON YOUR SYSTEM
sudo apt-get update
sudo apt-get install postgresql-9.1
# List All Postgres related packages
dpkg -l | grep postgres