Skip to content

Instantly share code, notes, and snippets.

@danisfermi
danisfermi / setupdb.md
Created December 15, 2017 23:00
Setup gdb on Mac OS Sierra/High Sierra

Here are the steps to installing and setting up GDB on Mac OS Sierra/High Sierra. Run brew install gdb. On starting gdb, you will get the following error:

Unable to find Mach task port for process-id 2133: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))

To fix this error, follow the following steps:

@yocontra
yocontra / aoe2hd.md
Last active June 9, 2023 18:28
Age of Empires II HD - For Mac OSX
@mgaitan
mgaitan / srt2txt.py
Last active April 23, 2020 18:27
Convert subtitles to plain text
#!/usr/bin/env python
import sys
import re
import textwrap
def str2txt(srt):
lines = re.sub(r'^$\n|^[0-9].*\n|^\n','', srt, flags=re.MULTILINE | re.UNICODE)
print(textwrap.fill(lines, 70))
if __name__ == '__main__':
@bardo
bardo / README.md
Last active January 5, 2022 01:54
Watch a web page for edits with IFTTT and urlwatch

This setup allows to trigger an IFTTT event whenever a web page changes. It uses the urlwatch utility and the IFTTT Maker Channel.

Instructions:

  • Sign up to IFTTT.
  • Connect IFTTT's Maker Channel, and take note of your Maker key.
  • Create a new Recipe that takes the Maker Channel as input and outputs wherever you want. I used IF Notifications with the IF Android app, so that I get a notification on my phone whenever the trigger runs. The script passes the updated URL to IFTTT as value1, and my notification contains URL updated: {{Value1}}, so that I know which of the web pages has been updated.
  • On the machine that will check the website for changes install urlwatch and python2-requests.
  • Echo the URLs to check to ~/.urlwatch/urls.txt, one per line.
  • Then, copy over my hooks.py to ~/.urlwatch/libs/hooks.py adding the URLs to the ifttt_urls tuple and substituting YOUR_TRIGGER_NAME and YOUR_MAKER_KEY.
@revolunet
revolunet / python-es6-comparison.md
Last active April 22, 2024 19:22
# Python VS JavaScript ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active July 16, 2024 17:25
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@masih
masih / fish_shell_local_install.sh
Last active June 1, 2024 22:23
Installs Fish Shell without root access
#!/bin/bash
# Script for installing Fish Shell on systems without root access.
# Fish Shell will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
FISH_SHELL_VERSION=2.1.1
@wacko
wacko / gist:5577187
Last active July 13, 2024 00:48
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

@doches
doches / reference.lua
Created March 27, 2012 19:47
Lua Cheat Sheet
-- Lua Cheat Sheet for Programmers, by Al Sweigart http://coffeeghost.net
-- This cheat sheet is an executable Lua program.
--[[ This is
a multline comment]]
---[[ This is a neat trick. The first -- makes -[[ not a multiline comment.
print("This line executes.")
--]] The rest of this line is also a comment.
print("Here is a string" .. ' concatenated with ' .. 2 .. ' other strings.')
@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git