Skip to content

Instantly share code, notes, and snippets.

View iTrauco's full-sized avatar

Christopher Lee iTrauco

View GitHub Profile
@iTrauco
iTrauco / patch-edid.md
Created May 13, 2018 22:34 — forked from kurtschlatzer/patch-edid.md
Fix EDID problems on external monitors in Mac OS.
@iTrauco
iTrauco / Google Apps Script Survey Workflow.md
Created August 16, 2018 04:53 — forked from mogsdad/Google Apps Script Survey Workflow.md
Google Apps Script workflow for an email survey. Written in response to StackOverflow question 18668828. http://stackoverflow.com/a/18669532/1677912

Google Apps Script Survey Workflow

The components involved in this workflow are:

  • A script to generate and send an email with an HTML form.
  • An html template for that email, which allows us to customize the email for each recipient.
  • A doPost() function to handle responses. The script must be [deployed as a Web App][1].
  • A spreadsheet to collect responses. The script will be contained in the spreadsheet, and extends the spreadsheet UI with a menu for sending a copy of the survey. (It could be adapted for standalone use, without the UI component.)

Here is an example of such a workflow, conducting a Commuting Survey. Recipients will receive a survey email like this:

@iTrauco
iTrauco / if else text.js
Created August 16, 2018 04:57 — forked from oyakudachi/if else text.js
Google apps script
if(rng[i]=="赤テキスト"){
sht.getRange(i+4,4).setValue('赤文字').setHorizontalAlignment("center").setFontColor("red");
}else if(rng[i]=="赤テキスト黄色塗り"){
sht.getRange(i+4,4).setValue('赤&黄色').setHorizontalAlignment("center").setFontColor("red").setBackground(color);
}else{
sht.getRange(i+4,4).setValue('青文字').setHorizontalAlignment("center").setFontColor("blue");
}
@iTrauco
iTrauco / export.sql
Created April 16, 2019 03:48 — forked from LarsKumbier/export.sql
Export Postgresql for mongoimport
COPY (
SELECT
userid AS "userId.auto()",
'some-static-string' AS "__classname__.auto()",
failed_login_count AS "failedLoginCount.int32()",
CASE WHEN mail_validated=TRUE THEN 'TRUE' ELSE 'FALSE' END AS "mailValidated.boolean()",
-42 AS "answers.toTheQuestion.int32()",
'Slate Star Codex' AS "answers.niceBlog.auto()"
FROM
users.accounts
@iTrauco
iTrauco / ISC.md
Created September 19, 2019 01:13 — forked from indexzero/ISC.md
ISC vs. MIT

Copyright (c) 4-digit year, Company or Person's Name

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Source: http://opensource.org/licenses/ISC

sudo apt install -y ctags miscfiles python3-dev python3-pip python-dev python-pip rsync shellcheck software-properties-common wbritish wbritish-huge ruby ruby-dev npm
sudo select-default-wordlist
sudo apt-add-repository ppa:neovim-ppa/stable
sudo apt-get update
sudo apt-get install -y --reinstall neovim
sudo update-alternatives --install /usr/bin/vi vi /usr/bin/nvim 60
sudo update-alternatives --install /usr/bin/vim vim /usr/bin/nvim 60
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/nvim 60
sudo update-alternatives --config vi
sudo update-alternatives --config vim
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@iTrauco
iTrauco / sampleREADME.md
Created January 23, 2020 04:48 — forked from FrancesCoronel/sampleREADME.md
A sample README for all your GitHub projects.

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here

@iTrauco
iTrauco / .spacevim
Created June 2, 2020 09:12 — forked from rudibroekhuizen/.spacevim
space-vim config file (liuchengxu/space-vim)
" You can enable the existing layers in space-vim and
" exclude the partial plugins in a certain layer.
" The command Layer is vaild in the function Layers().
" Use exclude option if you don't want the full Layer,
" e.g., Layer 'better-defaults', { 'exclude': 'itchyny/vim-cursorword' }
function! Layers()
" Default layers, recommended!
Layer 'fzf'
Layer 'unite'
@iTrauco
iTrauco / .gitignore
Created July 4, 2020 20:35 — forked from thawk/.gitignore
SpaceVim custom init.vim
.netrwhist