Skip to content

Instantly share code, notes, and snippets.

View dataduke's full-sized avatar

Benjamin Nothdurft dataduke

View GitHub Profile
@wojteklu
wojteklu / clean_code.md
Last active June 9, 2024 21:41
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

1. Create a folder in Dropbox or Google Drive

We'll use ~/Dropbox/Macnotes in this example

2. Copy the notes folder to the new folder in Dropbox or Google Drive

We'll use Finder for this instead of terminal as the cp -r command also copies the contents of all aliases and the Notes folder has a lot of those. Quit notes Open terminal and enable hidden files in Finder:

defaults write com.apple.finder AppleShowAllFiles YES.
@rahul286
rahul286 / mac-osx-el-captain-commands.sh
Last active April 19, 2021 06:15
Updating to Mac elCapitan using downloaded pkg file
## based on https://github.com/lioonline/OS-X-El-Capitan
## pkg file link - http://osxapps.itunes.apple.com/apple-assets-us-std-000001/Purple3/v4/74/d2/82/74d28291-9db9-7ae2-305d-9b8b3f5fd463/ftk3252456602304584541.pkg
# Run this from folder where you have downloaded or copied ftk3252456602304584541.pkg file
#create a tmp folder
mkdir elCapitanRoot && cd elCapitanRoot
#create a folder structure to match apple server
sudo mkdir -p ./apple-assets-us-std-000001/Purple3/v4/74/d2/82/74d28291-9db9-7ae2-305d-9b8b3f5fd463/
node {
// https://registry.hub.docker.com/_/maven/
def maven32 = docker.image('maven:3.2-jdk-7-onbuild');
stage 'Mirror'
// First make sure the slave has this image.
// (If you could set your registry below to mirror Docker Hub,
// this would be unnecessary as maven32.inside would pull the image.)
maven32.pull()
// We are pushing to a private secure docker registry in this demo.
@mrbobbytables
mrbobbytables / init-boot2docker.sh
Created November 11, 2014 11:48
boot2docker OSX mount helper
#!/bin/bash
set -o errexit -o nounset -o pipefail
usage() {
cat << EOF
USAGE:
init-boot2docker.sh -p [path] -u [uid] -g [gid]
-p Path to the working directory you wish to mount.
-u The uid you wish to mount the working directory as.
@lovellfelix
lovellfelix / rubyoncentos.sh
Last active January 29, 2020 13:57
Install Ruby with Bundler on CentOS 6.5 [RVM Example]
#!/bin/bash
echo "Starting Installation..."
# Install dependencies
yum install gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel ruby-devel libxml2 libxml2-devel libxslt libxslt-devel git
# Install Ruby from rvm
\curl -sSL https://get.rvm.io | bash -s stable --ruby
@hoylen
hoylen / getopt-example.sh
Last active July 23, 2020 11:59
Portable getopt argument processing in shell scripts. Detects which version of getopt is installed. When available, it uses GNU enhanced getopt to support long option names and whitespaces in arguments. Otherwise, defaults to using the original getopt.
#!/bin/sh
#
# Example showing use of getopt detection and use of GNU enhanced getopt
# to handle arguments containing whitespace.
#
# Written in 2004 by Hoylen Sue <hoylen@hoylen.com>
#
# To the extent possible under law, the author(s) have dedicated all copyright and
# related and neighboring rights to this software to the public domain worldwide.
# This software is distributed without any warranty.
@ttscoff
ttscoff / grab links.bookmarklet
Last active May 23, 2024 19:21
Create a bookmark and paste the code from `grab links.bookmarklet` into the url. Trigger it on a page containing links you want to save and then click the section of the page containing the links. A Markdown list of all links will be generated, and clicking the resulting list will select all for copying.

In case you don't know me already, I'm Jarrod Nettles, a Senior Developer at Apple Inc. I also go by the Twitter handle @hayvok, and blackshawk on Github (don't ask me why they're different). I have no real, formal blog since, well, I work at Apple. I'm posting this because I confused a good many people and I feel honor-bound to explain.

On April 1st Hacker News had their "Who's Hiring" thread. Since I'm currently looking for a developer, I decided to go ahead and post. Here's the content of that post, along with a link to the original.

https://news.ycombinator.com/item?id=5475813 - Original HN Post

Apple Inc: Cupertino, CA - Web Developer (PHP, Node.js, Ember.js) - Sorry, no remote!! Relocation offered. (I know, I know...) We're rebuilding an internal app from scratch and it needs to be blazing fast and real-time.
Here's our tech stack (right now).