Skip to content

Instantly share code, notes, and snippets.

@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Created Sep 24, 2016
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
View create-iso.sh
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
@RobTrew
RobTrew / JXA_UIToggle.applescript
Created Feb 24, 2015
OS X Yosemite Javascript for Applications (JXA): Toggling background, dark mode, and screen color inversion between day ⇄ night settings
View JXA_UIToggle.applescript
function run() {
// Rob Trew 2015
// Ver 0.01
// UI day/night toggling through OS X 10.10 JXA Javascript for Automation
// SWITCH FROM DAY-TIME DARK MENU BAR AND DOCK WITH DARK BACKGROUND
// TO NIGHT-TIME *ALL DARK*
// (TOGGLE MODE AND BACKGROUND TO BRIGHT, THEN INVERT ALL)
@mwhite
mwhite / git-aliases.md
Last active Sep 23, 2021
The Ultimate Git Alias Setup
View git-aliases.md

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@itayadler
itayadler / gist:3579128
Created Sep 1, 2012
List of Gary Bernhardt talks
View gist:3579128
@aheckmann
aheckmann / storeImgInMongoWithMongoose.js
Created Apr 17, 2012
store/display an image in mongodb using mongoose/express
View storeImgInMongoWithMongoose.js
/**
* Module dependencies
*/
var express = require('express');
var fs = require('fs');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// img path