Skip to content

Instantly share code, notes, and snippets.

View Zodiase's full-sized avatar

Xingchen Hong Zodiase

View GitHub Profile
@walkerjeffd
walkerjeffd / Synology-Diskstation-Git.md
Last active May 19, 2024 21:30
Instructions for setting up git server on Synology Diskstation

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.

Set Up User and Folder

  • Create user gituser via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.
  • Install Git Server package via Diskstation
@Zodiase
Zodiase / isThisTestFileRunExplicitly.js
Created April 18, 2024 18:29
Skip test file unless explicitly targeted. This allows an "unfriendly" test file to live along other test files and not interfere "run all tests".
/**
* This test file should only be run explicitly. When that's the case, the command should look something like:
* npm run test ./some/test/folder/test-something.js
* which means the process arguments should be something like:
* [ "some/path/node", "some/path/mocha", "./some/test/folder/test-something.js" ]
* but we can not assume the third argument would always be a file path.
* So to evaluate this flag, the function should:
* 1. Check if argv[2] is likely a file path pointing at this file.
* 2. resolve argv[2] and compare with this file's absolute path.
*/
@Zodiase
Zodiase / 1 - Get paths and filenames from aliases.scpt
Last active February 26, 2024 09:57
Folder Action: Save Discover Statements to Evernote
# Expect input to be a list of file alias.
on run {aliasList, parameters}
set fileInfoList to {}
repeat with aliasItem in aliasList
set thePath to POSIX path of aliasItem
set theName to name of (info for aliasItem)
set end of fileInfoList to {thePath:thePath, theName:theName}
end repeat
@idleberg
idleberg / sublime-text-macos-context-menu.md
Last active February 20, 2024 09:37 — forked from vincentmac/sublime-text-osx-context-menu.md
“Open in Sublime Text” in macOS context-menu

This list has been updated for Big Sur (and later). Since I don't use these versions, this guide might still need further improvements. For older macOS versions, please see this older revision.

Open in Sublime Text

  • Open Automator
  • Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
@ekristen
ekristen / check_docker_container.sh
Last active January 16, 2024 16:15
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
@Zodiase
Zodiase / document.wflow
Created August 8, 2016 11:06
Zip Each - Automator Workflow
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AMApplicationBuild</key>
<string>419</string>
<key>AMApplicationVersion</key>
<string>2.6</string>
<key>AMDocumentVersion</key>
<string>2</string>
@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Created September 24, 2016 21:46
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/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
@Zodiase
Zodiase / es6-abstract-class-example.js
Last active July 18, 2022 11:03
ES6 Abstract Class Example
'use strict';
class Abstract {
// A static abstract method.
static foo() {
if (this === Abstract) {
// Error Type 2. Abstract methods can not be called directly.
throw new TypeError("Can not call static abstract method foo.");
} else if (this.foo === Abstract.foo) {
// Error Type 3. The child has not implemented this method.
throw new TypeError("Please implement static abstract method foo.");
@Zodiase
Zodiase / Tutorial.md
Last active December 28, 2020 19:24
How to: Get Eon Ticket for Omega Ruby & Alpha Sapphire on Nintendo 3DS.
  1. Fake a special Wi-Fi access point.
    1. The goal is to disguise your Wi-Fi access point to trick your 3DS into believing that it's in contact with some special Wi-Fi access points.
    2. The following steps are assuming using a Mac computer just because that's what I did. If you have some other devices, the overall process should be similar.
    3. Change the MAC address of your Wi-Fi card.
      1. Write down the original MAC address of the Wi-Fi card so you can restore it later. You could find the MAC address in your system report.
      2. Also find the network interface name of your Wi-Fi card. In my case that's "en1".
      3. Turn on your Wi-Fi so that the Wi-Fi card is powered on.
  2. Open Terminal, run sudo ifconfig en1 ether 4E:53:50:4F:4F:4C to change the MAC address of your Wi-Fi card.
@Zodiase
Zodiase / heroku-meteor-deploy-setup.sh
Last active July 20, 2018 09:36
Setup deploying Meteor app in existing Git repo to Heroku
#!/bin/bash
# Login to heroku CLI.
heroku login
# Create a new app project on heroku.
heroku create <appName> --stack cedar --region us --buildpack https://github.com/AdmitHub/meteor-buildpack-horse.git
# Add heroku remote to the git config file.
heroku git:remote -a meteor-mdc-demo