Skip to content

Instantly share code, notes, and snippets.

💀
alter.

gregory nicholas gregorynicholas

💀
alter.
Block or report user

Report or block gregorynicholas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gregorynicholas
gregorynicholas / GCalUtils.md
Created Nov 17, 2019 — forked from mogsdad/GCalUtils.md
Collection of Google Calendar related utility functions for Google Apps Script.
View GCalUtils.md

Google Calendar Utilities

getEventsWithGuest

Gets all events that occur within a given time range, and that include the specified guest email in the guest list.

###Parameters:###

@gregorynicholas
gregorynicholas / convertSheet2Json.gs
Created Nov 17, 2019 — forked from daichan4649/convertSheet2Json.gs
spreadsheet のデータを JSON として読み込む(Google Apps Script)
View convertSheet2Json.gs
function convertSheet2Json(sheet) {
// first line(title)
var firstRange = sheet.getRange(1, 1, 1, sheet.getLastColumn());
var firstRowValues = firstRange.getValues();
var titleColumns = firstRowValues[0];
// after the second line(data)
var lastRow = sheet.getLastRow();
var rowValues = [];
for(var rowIndex=2; rowIndex<=lastRow; rowIndex++) {
@gregorynicholas
gregorynicholas / pullJSON.js
Created Nov 17, 2019 — forked from varun-raj/pullJSON.js
Google App Script To Fetch Data From JSON Webservice and Write them to google spreadsheet.
View pullJSON.js
function pullJSON() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
var sheet = ss.getActiveSheet();
var url="http://example.com/feeds?type=json"; // Paste your JSON URL here
var response = UrlFetchApp.fetch(url); // get feed
var dataAll = JSON.parse(response.getContentText()); //
View gist:8e8454c03fec0b240480dff4e7d14ec1
#!/usr/bin/env python
# To look at: https://github.com/kcrawford/mac-network/blob/master/lib/mac-network/wifi.rb
# To look at: https://stackoverflow.com/questions/28096630/mac-os-x-10-10-reorder-preferred-networks
'''
Playing around with CoreWLAN to return information about the wi-fi connection
Documentation:
https://developer.apple.com/library/mac/documentation/CoreWLAN/Reference/CWInterface_reference/translated_content/CWInterface.html
@gregorynicholas
gregorynicholas / marketing.py
Created Oct 3, 2019 — forked from pudquick/marketing.py
Using PrivateFrameworks to get marketing model information for Apple Macs without hitting their internet API (where possible) via python and pyobjc
View marketing.py
# Tested on 10.11
# Note:
# The marketing information embedded in the ServerInformation.framework is not the same as what
# About This Mac displays - there are differences.
#
# For example:
# ServerInformation: 15" MacBook Pro with Retina display (Mid 2015)
# About This Mac: MacBook Pro (Retina, 15-inch, Mid 2015)
#
@gregorynicholas
gregorynicholas / make_firmwareupdater_pkg.sh
Created Oct 3, 2019 — forked from erikng/make_firmwareupdater_pkg.sh
Make standalone "universal" FirmwareUpdater package for High Sierra
View make_firmwareupdater_pkg.sh
#!/bin/sh
# Based on investigations and work by Pepijn Bruienne
# Expects a single /Applications/Install macOS Sierra*.app on disk
# Adapted from https://gist.github.com/gregneagle/7c802aef636ac4295536f2e360921bb1
IDENTIFIER="com.foo.FirmwareUpdateStandalone"
VERSION=1.0
# find the Install macOS Sierra.app and mount the embedded InstallESD disk image
echo "Mounting Sierra ESD disk image..."
@gregorynicholas
gregorynicholas / seedutil.md
Created Oct 3, 2019 — forked from pookjw/seedutil.md
Enroll macOS Beta Seed without profile installation
View seedutil.md

seedutil

Enroll macOS Beta Seed without profile installation

Usage

$ sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil 
usage: seedutil enroll SEED_PROGRAM
    seedutil unenroll
    seedutil current
@gregorynicholas
gregorynicholas / Installation.md
Created Oct 3, 2019 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac
View Installation.md

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@gregorynicholas
gregorynicholas / Example.scpt
Created Oct 3, 2019 — forked from pudquick/Example.scpt
Make DMGs from folders
View Example.scpt
property destination_for_dmgs : "/Users/mike/Desktop"
on open the_items
repeat with an_item in the_items
set the_info to info for an_item
if kind of the_info is "Folder" then
set dmg_path to quoted form of (destination_for_dmgs & "/" & (name of the_info) & ".dmg")
set src_path to quoted form of POSIX path of an_item
set vol_name to quoted form of (name of the_info)
set command_str to "hdiutil create " & dmg_path & " -volname " & vol_name & " -srcfolder " & src_path
View kextsthatwillmakeanadmincry.py
#!/usr/bin/python
# Credit to frogor for the objc
from Foundation import NSBundle
import json
import objc
import os
import plistlib
import subprocess
You can’t perform that action at this time.