For MacOS Catalina, visit Install mysql2 on MacOS Catalina
Installing mysql2
gem errors on MacOS Mojave.
Make sure openssl
is installed on Mac via Homebrew.
For MacOS Catalina, visit Install mysql2 on MacOS Catalina
Installing mysql2
gem errors on MacOS Mojave.
Make sure openssl
is installed on Mac via Homebrew.
import os | |
import zipfile | |
import time | |
class FileStat: | |
def __init__(self, filename, mod_time): | |
self.name = filename | |
self.mod_time = mod_time |
#!/bin/bash | |
# Vadim Zaliva lord@crocodile.org | |
# based on https://gist.github.com/hadess/6847281 | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi |
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
# Copied from http://blog.salsify.com/engineering/tearing-capybara-ajax-tests | |
# https://gist.github.com/jturkel/9317269/raw/ff7838684370fd8a468ffe1e5ce1f3e46ba39951/rack_request_blocker.rb | |
require 'atomic' | |
# Rack middleware that keeps track of the number of active requests and can block new requests. | |
class RackRequestBlocker | |
@@num_active_requests = Atomic.new(0) | |
@@block_requests = Atomic.new(false) |
public class Backtrack { | |
public static List<List<Object>> backtrack(int[] A) { | |
// Set up a list of list to hold all possible solutions | |
List<List<Object>> result = new LinkedList<List<Object>>(); | |
if (A == null || A.length == 0) { | |
return result; | |
} | |
// As we need to recursively generate every solution, | |
// a variable is needed to store single solution. |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger
var http = require('http'); | |
var querystring = require('querystring'); | |
var MailParser = require("mailparser").MailParser; // https://github.com/andris9/mailparser | |
var server = http.createServer(); | |
server.addListener('request', function(req, res) { | |
var chunks = []; | |
req.on('data', chunks.push.bind(chunks)); | |
req.on('end', function() { | |
var mailparser = new MailParser(); |
Every couple of weeks, I hear someone complaining about some difficulties with Bundler. Yesterday, it happened twice. But somehow I just never have those difficulties. I'm not saying Bundler is perfect; certainly in its early days it wasn't even close. But for the past two years it's been incredibly solid and trouble-free for me, and I think a large part of the reason is the way I use it. Bundler arguably does too much, and just as with Git, a big part of it is knowing what not to do, and configuring things to avoid the trouble spots.