Skip to content

Instantly share code, notes, and snippets.

View bitliner's full-sized avatar

Giovanni Gaglione bitliner

View GitHub Profile

Homebrew: How to Backup & Restore Homebrew Packages

Homebrew makes it easy to install and keep installed software up to date on your Mac - as part of my backup routine for my Mac I want to be able to run a single command to reinstall all packages.

If you're searching on how to backup & restore Homebrew, then I assume you're here for the commands.

Brewfiles

Brewfiles are files generated with definitions that Homebrew reads and processes, a generated

@bitliner
bitliner / web-servers.md
Created January 18, 2020 11:01 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@bitliner
bitliner / readme.md
Created December 10, 2018 01:24 — forked from RaVbaker/readme.md
[HOWTO] Forward ports a.k.a. make SSH Tunneling

Syntax:

ssh -L localport:host:hostport user@ssh_server -N 

where:

  • -L - port forwarding parameters (see below)
  • localport - local port (chose a port that is not in use by other service)
  • host - server that has the port (hostport) that you want to forward
  • hostport - remote port
@bitliner
bitliner / test_api_with_authentication.js
Last active July 18, 2020 07:56 — forked from bq1990/gist:595c615970250e97f3ea
Supertest authenticate with bearer token
'use strict';
var should = require('should');
var app = require('../../app');
var request = require('supertest')(app);
describe('GET /api/incidents', function() {
it('should require authorization', function(done) {
request
# coding=UTF-8
import nltk
from nltk.corpus import brown
# This is a fast and simple noun phrase extractor (based on NLTK)
# Feel free to use it, just keep a link back to this post
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/
# Create by Shlomi Babluki
# May, 2013
@bitliner
bitliner / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@bitliner
bitliner / person.ajs
Created February 10, 2014 05:55 — forked from tj/person.ajs
// Alternative JavaScript Syntax
Person = :(name, address) { @name!, @address! }
Person::inspect = :{ <: "{@name} lives at {@address}" }
tj := Person('TJ', '314 Bessborough ave')
bob := Person('Bob', 'Some place')
[tj, bob].each(:(person){ print(person.inspect()) })