Skip to content

Instantly share code, notes, and snippets.

@mhawksey
mhawksey / gist:2252211
Created March 30, 2012 15:15
Google Apps Script to combine data from different sheets (used in http://mashe.hawksey.info/?p=13130)
function combineData(){
var doc = SpreadsheetApp.getActiveSpreadsheet();
var sheets = doc.getSheets(); // get all the sheets
var outSheet = doc.getSheetByName("combined"); // set where we want to write the results
for (i in sheets){ // loop across all the sheets
if (sheets[i].getSheetName().substring(0,9) == "followers"){ // if sheetname starts with 'follower' then
var target = sheets[i].getSheetName().substring(12); // extract users name for target column
var data = getRowsData(sheets[i]); // get extisting data from current sheet
for (j in data){
data[j]["target"] = target; // create a target column with the users name
@nhoffman
nhoffman / pyscript.py
Last active February 20, 2024 22:30
Python script template
#!/usr/bin/env python3
"""A simple python script template.
"""
import os
import sys
import argparse
@lincank
lincank / pdfform.py
Created September 11, 2012 06:38
collect fillable form data from all pdf files in the input directory, and generate a "output.csv" file in the input directory
"""
collect fillable form data from all pdf files in the input directory,
and generate a "output.csv" file in the input directory
Dependency: pdfminer
Install: pip install pdfminer
Usage:
@wacko
wacko / gist:5577187
Last active January 6, 2024 07:31
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0

@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 5, 2024 18:31
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@jdforsythe
jdforsythe / connect.ps1
Last active February 19, 2024 11:05
Remote Desktop Auto Login Powershell Script
cmdkey /list | ForEach-Object{if($_ -like "*target=TERMSRV/*"){cmdkey /del:($_ -replace " ","" -replace "Target:","")}}
echo "Connecting to 192.168.1.100"
$Server="192.168.1.100"
$User="Administrator"
$Password="AdminPassword"
cmdkey /generic:TERMSRV/$Server /user:$User /pass:$Password
mstsc /v:$Server
@Spencer-Easton
Spencer-Easton / exportSpreadsheet.gs
Last active March 21, 2024 00:43
Example on how to export a Google sheet to various formats, includes most PDF options
function exportSpreadsheet() {
//All requests must include id in the path and a format parameter
//https://docs.google.com/spreadsheets/d/{SpreadsheetId}/export
//FORMATS WITH NO ADDITIONAL OPTIONS
//format=xlsx //excel
//format=ods //Open Document Spreadsheet
//format=zip //html zipped
@sergey-dryabzhinsky
sergey-dryabzhinsky / nginx-vhost-proxprox.conf
Last active April 18, 2022 20:15
Nginx virtual host config for Proxmox. To hide pveproxy on 8006 port behind. With working VNC passthrough.
###
# Nginx vhost file to hide Proxmox pveproxy
# For 3.4+, 5.x version.
#
# Do not forget to create file
# /etc/default/pveproxy:
# ALLOW_FROM="127.0.0.1"
# DENY_FROM="all"
# POLICY="allow"
#
@arthurattwell
arthurattwell / dialog.html
Last active August 1, 2022 09:54
Google Sheets script to allow multi-select in cells with data-validation (adapted from https://www.youtube.com/watch?v=dm4z9l26O0I)
<div style="font-family: sans-serif;">
<? var data = valid(); ?>
<form id="form" name="form">
<? if(Object.prototype.toString.call(data) === '[object Array]') { ?>
<? for (var i = 0; i < data.length; i++) { ?>
<? for (var j = 0; j < data[i].length; j++) { ?>
<input type="checkbox" id="ch<?= '' + i + j ?>" name="ch<?= '' + i + j ?>" value="<?= data[i][j] ?>"><?= data[i][j] ?><br>
<? } ?>
<? } ?>
<? } else { ?>