Take pictures of your important documents (driver's license, passport, birth certificate, etc.) and store them securely with an app that will sync to your computers and mobile devices.
Do this now
#!/usr/bin/env ruby | |
require "webrick" | |
server = WEBrick::HTTPServer.new(Port: 8080, DocumentRoot: Dir::pwd) | |
trap("INT") { server.shutdown } | |
server.start |
class Regexp | |
def to_proc | |
proc {|str| match(str) && $~.to_s } | |
end | |
end | |
arr = [ "foo", "bar 123", "baz", "456", "789 qux" ] | |
p arr.find(&/bar/) # => "bar 123" |
# https://minhajuddin.com/2016/03/03/put-this-in-your-code-to-debug-anything | |
require 'rouge' | |
require 'method_source' | |
require 'pp' | |
class Dbg | |
def initialize(object, to:) | |
@object, @stream = object, to | |
end |
// exporter1.js | |
let foo = 1; | |
export { foo as default }; // exports the foo binding | |
foo = 2; | |
// exporter2.js | |
let foo = 1; | |
export default foo; // creates a new binding named *default* and initializes it to 1. | |
foo = 2; // assigns to the foo binding which is not exported |
var React = require('react/addons'), | |
TestUtils = React.addons.TestUtils, | |
TestContext = require('./TestContext'), | |
App = require('./App.jsx'), | |
app = TestContext.getRouterComponent(App); | |
describe('App', function() { | |
it('has something', function() { | |
expect(app.getDOMNode().textContent).toContain('something'); | |
}); |
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab: | |
# Author: Avishai Ish-Shalom <avishai@fewbytes.com> | |
# We need to specify GNU sed for OS X, BSDs, etc. | |
if [[ "$(uname -s)" == "Darwin" ]]; then | |
SED=gsed | |
else | |
SED=sed | |
fi |
#!/usr/bin/env bash | |
# Usage: setup-git-bundler-merge-driver | |
# Help: Configures git to use a custom merge driver to resolve Gemfile.lock | |
# merge conflicts. | |
if [ ! -f Gemfile ]; then | |
echo 'No `Gemfile` found! Aborting' | |
exit 1 | |
fi |
-- Apple Script to connect VPN Client with Password and Safenet MobilePass OTP. | |
set vpn_name to "'VPN Connection 01'" | |
set user_name to "username" | |
set passwd to "Password" | |
tell application "MobilePASS" | |
activate | |
end tell | |
tell application "System Events" |
class Question < ActiveRecord::Base | |
# UGLY | |
def self.starts_with(*strings) | |
# Big loop to build something like this... | |
where("wording LIKE ? OR wording LIKE ? OR wording LIKE ?", 'blah%', 'blaah%', 'blaaah%') | |
end | |
# PURDY | |
def self.starts_with(*strings) | |
strings = strings.map { |s| s+'%' } |