Skip to content

Instantly share code, notes, and snippets.

thefonso thefonso

Block or report user

Report or block thefonso

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thefonso
thefonso / install_ruby_with_rbenv.md
Created Mar 18, 2020 — forked from stonehippo/install_ruby_with_rbenv.md
Installing a new Ruby with rbenv on Mac OS
View install_ruby_with_rbenv.md

Install a new Ruby with rbenv on Mac OS (and make yourself a superhero)

If you're doing stuff with Ruby on a Mac, e.g. installling Jekyll or something, by default you'll end up having to use the sudo command to do stuff, since the permission to modify the default config is not available to your user account.

This sucks and should be avoided. Here's how to fix that.

Installing a new Ruby

To make this better, we are going install a new, custom Ruby. This used to be a big, scary thing, but thanks to the awesome tools Homebrew and rbenv, it's a snap.*

A word of warning: you will have to use Terminal to install this stuff. If you are uncomfortable with text, words, and doing stuff with your computer beyond pointing and hoping, this may not work well for you. But if that's the case, I'm not sure why you were trying to use Ruby in the first place.

@thefonso
thefonso / google-image.md
Last active Nov 10, 2019
example for anthony
View google-image.md

This is a gist file saved with a markdown extension (.md)

Below are two examples of how to add an image to a gist file...click the "Raw" button to view the source

Google image of the day

Text to display

@thefonso
thefonso / rbenv-ruby193-macos.sh
Last active Jul 7, 2019
install ruby 193-p194 on MacOS with rbenv
View rbenv-ruby193-macos.sh
#!/bin/sh
# 1) Install Xcode 10
# 2) Install command line tools: `xcode-select --install`
# 3) Install macOS system headers to `/usr/include`
# /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
# (See https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes)
# 4) Install HomeBrew
# 5) brew install openssl gcc@6 rbenv
# 6) Setup rbenv
@thefonso
thefonso / postgresql_mac.md
Created Jul 2, 2019
Getting Started with PostgreSQL on Mac OS X
View postgresql_mac.md

PostgreSQL on Mac OS X

Install, and verify the installation.

$ brew install postgresql
$ postgres —help
postgres is the PostgreSQL server.
...
$ psql --help
psql is the PostgreSQL interactive terminal.
@thefonso
thefonso / squeeze.dockerfile
Created Jul 2, 2019 — forked from ricsiga/squeeze.dockerfile
Debian Squeeze Dockerfile example
View squeeze.dockerfile
FROM debian:squeeze
RUN echo "deb http://archive.debian.org/debian squeeze main" > /etc/apt/sources.list
RUN echo "deb http://archive.debian.org/debian squeeze-lts main" >> /etc/apt/sources.list
RUN echo "Acquire::Check-Valid-Until false;" > /etc/apt/apt.conf
RUN apt-get update
RUN apt-get install -y procps vim nano tmux curl
CMD ["/bin/bash"]
View sass-px-to-em-converter.md

sass-px-to-em-converter

Diddy SASS helper to generate CSS in EMs when your designers specify pixels:

  // Helper to convert the designers' px specifications into EMs:
  // Eg: H2 { font-size: em(28px); }
  @function em( $px, $basePx: $baseFontPx ) {
    $px:     $px     / ($px     * 0 + 1);   // Strip off units to be sure we have a plain number. (eg: 20px -> 20)
View global-gitignore.md

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file. Create a file called .gitignore in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.

Mac

git config --global core.excludesfile ~/.gitignore

Windows

git config --global core.excludesfile %USERPROFILE%\.gitignore
@thefonso
thefonso / restart_bluetooth.sh
Created Jan 7, 2019 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
View restart_bluetooth.sh
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@thefonso
thefonso / findNumber.js
Created Oct 22, 2018 — forked from dre4success/cloudSettings
Given an unsorted array of n elements, find if the element k is present in the given array or not. return 'YES' or 'NO'
View findNumber.js
function findNumber(arr, k) {
let result = 'NO';
arr.forEach(item => {
if(k === item) {
return result = 'YES';
}
})
return result;
}
@thefonso
thefonso / keybase.md
Created Aug 19, 2018
that slack like app....keybase
View keybase.md

Keybase proof

I hereby claim:

  • I am thefonso on github.
  • I am thefonso (https://keybase.io/thefonso) on keybase.
  • I have a public key ASBUJkz78Smk9DCKdZCkBX5SpZsfM1G6eOOk2u1M6idaZwo

To claim this, I am signing this object:

You can’t perform that action at this time.