Skip to content

Instantly share code, notes, and snippets.

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

Andre Garrigo andre3k1

🏠
Working from home
View GitHub Profile
@andre3k1
andre3k1 / Correct_GnuPG_Permission.sh
Created February 17, 2023 18:13 — forked from oseme-techguy/Correct_GnuPG_Permission.sh
This fixes the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error while using Gnupg .
#!/usr/bin/env bash
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error
# Make sure that the .gnupg directory and its contents is accessibile by your user.
chown -R $(whoami) ~/.gnupg/
# Also correct the permissions and access rights on the directory
chmod 600 ~/.gnupg/*
chmod 700 ~/.gnupg
@andre3k1
andre3k1 / edit-and-execute-command.sh
Created November 27, 2018 20:27
Editing long shell commands in Sublime Text with edit-and-execute-command
## Editing long shell commands in Sublime Text with edit-and-execute-command
##
##
## Typing "subl" on command line will open Sublime Text by adding this symlink
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl ~/bin/subl
##
##
## Make Sublime Text the default editor...
##
## ...if using BASH
@andre3k1
andre3k1 / install-gnu-sed-on-mac-osx.sh
Created July 26, 2018 18:39
How to install gnu sed on Mac OS X and set it as the default
# Check which version of sed is used when you run the `sed` command
# The version that ships with Mac OS X is
# /usr/bin/sed
which sed
# Install gnu-sed using Homebrew
# The `--with-default-names` option configures `sed` to use gnu-sed
# Without that option, you'll need to type `gsed` to use gnu-sed
brew install --default-names gnu-sed
@andre3k1
andre3k1 / regex_patterns.md
Created July 23, 2018 16:19
Regular Expressions - Special Character Definitions

Regular Expressions

The following should be escaped if you are trying to match that character

\ ^ . $ | ( ) [ ]
* + ? { } ,

Special Character Definitions

####################################################################
# Change the number of rows and columns to display in Launchpad #
# by typing the following two lines in Terminal. You can use any #
# two integers for the number of rows and columns. I'm using 15x10 #
####################################################################
defaults write com.apple.dock springboard-columns -int 15
defaults write com.apple.dock springboard-rows -int 10

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@andre3k1
andre3k1 / flac_to_mp3_converter.sh
Last active August 29, 2015 14:18 — forked from awnion/flac2mp3.sh
Convert lossless FLAC audio files to lossy 320kbps MP3 files, preserving ID3 meta tag info.
#!/bin/bash
# You need ffmpeg and lame utils, which you can install with homebrew: $ brew install ffmpeg lame
# Tip – Try adding this one liner to your bash profile as an alias.
find . -name "*.flac" -exec ffmpeg -i {} -acodec libmp3lame -ab 320k {}.mp3 \;
<?php
include("lib/http.php");
include("lib/parse.php");
$product_array = array();
$product_count = 0;
# Download the target web page
$target = "http://www.webbotsspidersscreenscrapers.com/buyair/";
[
{
"key": "group_543eec205dd50",
"title": "Sponsors Options",
"fields": [
{
"key": "field_543eec40c0b04",
"label": "Top Banner Sponsors",
"name": "top_banner_sponsors",
"prefix": "",
@andre3k1
andre3k1 / sunrise-calendar-icons.txt
Created January 27, 2015 21:43
An unofficial list of available icons in the Sunrise calendar app. Found any others? Let me know. http://support.sunrise.am/article/36-event-icons
airplane
airport
bank
beer
bicycle
boat
breakfast
bus
buy
cab