Skip to content

Instantly share code, notes, and snippets.

@subfuzion
subfuzion / curl.md
Last active August 2, 2025 11:55
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@sebkouba
sebkouba / ParentChild.es6
Created February 17, 2016 06:00
Basic example to pass values between parent and child components in React.
/**
* Basic example to pass values between parent and child components in React
* Seems to be in line with this
* http://stackoverflow.com/questions/24147331/react-the-right-way-to-pass-form-element-state-to-sibling-parent-elements
* Now I have the state in parent and child. Is that good or bad? Why would I need it in child?
* Could probably take that out
* */
class Parent extends React.Component {
constructor(props) {
super(props);
@benlinton
benlinton / multiple_mysql_versions_for_development.md
Last active June 6, 2025 19:32
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.

@vitorbritto
vitorbritto / rm_mysql.md
Last active July 28, 2025 19:10
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@subfuzion
subfuzion / global-gitignore.md
Last active July 22, 2025 13:57
Global gitignore

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 any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@lucasdavila
lucasdavila / fixup.txt
Last active December 20, 2023 12:00
Fixing mac os yosemite issue "bash: fork: Resource temporarily unavailable"
# see the current limits
$ sysctl -a | grep maxproc
# increase it
$ sudo sysctl -w kern.maxproc=xxxx
$ sudo sysctl -w kern.maxprocperuid=xxx
# run at startup
$ sudo vim /etc/sysctl.conf
@damien-roche
damien-roche / rubymethodlookup.md
Last active June 26, 2025 14:51
A Primer on Ruby Method Lookup

A Primer on Ruby Method Lookup

Method lookup is a simple affair in most languages without multiple inheritance. You start from the receiver and move up the ancestors chain until you locate the method. Because Ruby allows you to mix in modules and extend singleton classes at runtime, this is an entirely different affair.

I will not build contrived code to exemplify the more complicated aspects of Ruby method lookup, as this will only serve to confuse the matter.

When you pass a message to an object, here is how Ruby finds what method to call:

1. Look within singleton class

@elskwid
elskwid / results.txt
Created August 14, 2014 22:52
Virtus speed comparison
> be ruby coerce-speed.rb
Rehearsal -------------------------------------------------------
Poro 0.020000 0.000000 0.020000 ( 0.025502)
MongoidDoc 0.460000 0.000000 0.460000 ( 0.464085)
VirtusModel 0.210000 0.010000 0.220000 ( 0.219621)
VirtusModelNoCoerce 0.060000 0.000000 0.060000 ( 0.062512)
---------------------------------------------- total: 0.760000sec
user system total real
Poro 0.010000 0.000000 0.010000 ( 0.004206)
@staltz
staltz / introrx.md
Last active August 2, 2025 18:25
The introduction to Reactive Programming you've been missing
@stevenyap
stevenyap / repl-with-pry.md
Created June 20, 2014 10:21
REPL-driven development in Ruby
gem 'pry'