Skip to content

Instantly share code, notes, and snippets.

View dardo82's full-sized avatar
🏠
Working from home

Michele Venturi dardo82

🏠
Working from home
View GitHub Profile
@romkatv
romkatv / two-line-prompt.zsh
Last active September 20, 2024 13:26
Two-line ZSH prompt
# Example of two-line ZSH prompt with four components.
#
# top-left top-right
# bottom-left bottom-right
#
# Components can be customized by editing set-prompt function.
#
# Installation:
#
# (cd && curl -fsSLO https://gist.githubusercontent.com/romkatv/2a107ef9314f0d5f76563725b42f7cab/raw/two-line-prompt.zsh)
@jnaecker
jnaecker / git+overleaf+github.md
Last active June 24, 2024 06:25
Using Overleaf as your TeX editor but getting your files to Github

git + overleaf + github

Setup

Connect Overleaf and your local repo

  1. Make a new project on Overleaf.
  2. In the share menu, copy the link from "Clone with git"
  3. On your computer:
    • use cd to navigate to where you want to put your project
@fallroot
fallroot / manipulating-plist-in-macos-cli.md
Created August 7, 2017 06:08
Manipulating Property List in macOS Command Line

Manipulating Property List in macOS Command Line

Tools

⚠️ defaults 명령어는 홈 경로(~)는 인식하지만 상대 경로(., ..)는 인식하지 않는다.

@vishwanath79
vishwanath79 / MacOS_Install_OpenCV.py
Last active May 9, 2019 17:35
Install OpenCV on Mac OS Sierra on Python 3.5
# 1. Download and install the latest Anaconda distribution from https://www.continuum.io/downloads#macos
# 2. Create a new Python environment. Make sure you choose python 3.5 as your python version for the virtual environment:
conda create -n myenv python=3.5
# 3. Activate the new environment using:
source activate myenv
@Tithen-Firion
Tithen-Firion / openload.js
Last active November 20, 2021 15:14
Openload: extract download URL using PhantomJS
// Usage: phantomjs openload.js <video_url>
// if that doesn't work try: phantomjs --ssl-protocol=any openload.js <video_url>
var separator = ' | ';
var page = require('webpage').create(),
system = require('system'),
id, match;
if(system.args.length < 2) {
console.error('No URL provided');
@scottopell
scottopell / fix_exfat_drive.md
Last active November 15, 2024 19:04
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

Disk Utility is unable to repair this at first, but the fix is this:

  1. Use diskutil list to find the right drive id.
  2. You want the id under the IDENTIFIER column, it should look like disk1s1
  3. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  4. -d is debug so you'll see all your files output as they're processed.
  5. Answer YES if it gives you the prompt Main boot region needs to be updated. Yes/No?
@misterch0c
misterch0c / pamcam
Last active January 12, 2022 06:36
Take a screenshot when someone enters a wrong password
#/etc/pam.d/system-auth
#%PAM-1.0
# Jump two rules if login succeeds.
auth [success=2 default=ignore] pam_unix.so nullok_secure
auth optional pam_exec.so /home/pamcam.sh
auth requisite pam_deny.so
# User gets here if authentication is successful. No denying, no cam module.
auth required pam_unix.so try_first_pass nullok
@kastnerkyle
kastnerkyle / install_tts.py
Last active December 1, 2021 17:27
Install speech toolkit and create features
from __future__ import print_function
import subprocess
import shutil
import os
import stat
import time
# This script looks extremely defensive, but *should* let you rerun at
# any stage along the way. Also a lot of code repetition due to eventual support
# for "non-blob" install from something besides the magic kk_all_deps.tar.gz
@edenwaith
edenwaith / CountOpenSafariTabs.scpt
Last active October 25, 2024 16:32
AppleScript: Count the number of open tabs in Safari
-- CountOpenSafariTabs.scpt
-- Author: Chad Armstrong
-- Date: 13 May 2016
-- Description: Count the number of open tabs in Safari
-- To run from CLI: osascript CountOpenSafariTabs.scpt
tell application "Safari"
--Variables
set winlist to every window
@AVatch
AVatch / sift.py
Created May 9, 2016 19:11
OpenCV SIFT
import cv2
import numpy as np
from matplotlib import pyplot as plt
# Import our game board
canvas = cv2.imread('./data/box_med.jpg')
# Import our piece (we are going to use a clump for now)
piece = cv2.imread('./data/piece_small.jpg')
# Pre-process the piece