Skip to content

Instantly share code, notes, and snippets.

Avatar

YE yugaego

View GitHub Profile
@yugaego
yugaego / test.asciidoc
Last active Nov 22, 2020
Asciidoctor possessive monospaced phrase render
View test.asciidoc

The class’ static methods make it easy to operate on files and directories.

===

The class' static methods make it easy to operate on files and directories. Then `monospaced follows.

===

@yugaego
yugaego / basics.md
Last active Nov 4, 2020
Markdown vs Org Mode Cheat Sheet
View basics.md

Markdown

Headings

Top Level Header

Second Level Header

Third Level Header

@yugaego
yugaego / init-dictionary.el
Created Apr 30, 2020 — forked from Superbil/init-dictionary.el
lookup dictionary in emacs on mac
View init-dictionary.el
;; from http://larkery.tumblr.com/post/465585528/emacs-dictionary-app
(defun mac-open-dictionary (the-word)
"Open Dictionary.app for the-word"
(interactive "Dictionary Lookup: ")
(shell-command
(concat "open \"dict:///" (replace-regexp-in-string "\"" "\\\\\"" the-word) "\"")))
;; see https://gist.github.com/1228110
;; dict.py is from http://sakito.jp/mac/dictionary.html
(defun dictionary ()
@yugaego
yugaego / setup.md
Last active Aug 14, 2018
Xcode Line Actions Custom Shortcuts
View setup.md

Setup

Based on [Stackoverflow solution][0]

Environment

  • Xcode 9.4.1
  • MacOS 10.13.6 High Sierra
@yugaego
yugaego / cert-install.bash
Last active Dec 28, 2021
Manage Let's Encrypt Certificate using Certbot with SSL Virtual Hosts
View cert-install.bash
#!/usr/bin/env bash
# Setup custom SSL virtual host with Lets Encrypt certificate
# In /etc/httpd/conf.d/ssl.conf add line 'IncludeOptional conf.d/ssl/*.host'
searchDir=../path/to/dir/with/domain/names/to/setup
hostsDir=/etc/httpd/conf.d/ssl
documentRoot=../path/to/www/dir
certNotificationsEmail=some@email.dev
dbConfig=../path/to/db/config.file
@yugaego
yugaego / console-command.js
Created May 5, 2018
Output Infusionsoft Merchants Accounts ID using JavaScript
View console-command.js
var merchants = 'Merchant Accounts:\n';
jQuery('#defaultMerchantAccount option').each(function(i, elem){
if (elem.value) {
merchants += '\t• ID ' + elem.value.split('|')[0] + '\t' + elem.text + '\n';
}
});
alert(merchants);
@yugaego
yugaego / composer.php
Created Nov 9, 2017
Running composer from a browser
View composer.php
<?php
header("Content-type: text/html");
//
// Run composer with a PHP script in browser
//
// http://stackoverflow.com/questions/17219436/run-composer-with-a-php-script-in-browser
error_reporting(E_ALL);
ini_set('display_errors', 1);
@yugaego
yugaego / install.md
Last active Jun 13, 2019
Mac OS 10.13 High Sierra Install PHP 7.0 Apache MariaDB With Homebrew
View install.md
@yugaego
yugaego / readme.md
Last active Sep 13, 2017
Install and Enable Supervisor on Centos 7
View readme.md

Install

sudo yum install supervisor
sudo systemctl enable supervisord
sudo systemctl start supervisord
sudo systemctl status supervisord

Example program

/etc/supervisord.conf

@yugaego
yugaego / driveclient
Created Jul 23, 2017
Rackspace services logs rotation
View driveclient
# docs
https://support.rackspace.com/how-to/cloud-backup-agent-logging-basics/
# file path
/etc/driveclient/log4cxx.xml
# contents
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="FILE" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/var/log/driveclient.log"/>