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.
$ python -m SimpleHTTPServer 8000
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.
$ python -m SimpleHTTPServer 8000
#!/usr/bin/env ruby | |
# Script to generate random images. Based on http://www.imagemagick.org/Usage/canvas/#random_blur | |
require 'optparse' | |
options = {} | |
optparse = OptionParser.new do |opts| |
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
# npm using https for git | |
git config --global url."https://github.com/".insteadOf [email protected]: | |
git config --global url."https://".insteadOf git:// | |
# npm using git for https | |
git config --global url."[email protected]:".insteadOf https://github.com/ | |
git config --global url."git://".insteadOf https:// |
FROM rails:4.2.3 | |
MAINTAINER Renato Filho <[email protected]> | |
ENV HOME /home/app | |
ENV RAILS_ENV development | |
RUN useradd -m -s /bin/bash app | |
RUN gem install -N bundler |
tap "caskroom/cask" | |
cask "google-chrome" | |
cask "firefox" | |
brew "chromedriver" | |
brew "geckodriver" |
// Source: https://twitter.com/calebporzio/status/1151876736931549185 | |
<div class="flex"> | |
<aside class="h-screen sticky top-0"> | |
// Fixed Sidebar | |
</aside> | |
<main> | |
// Content | |
</main> |
# frozen_string_literal: true | |
class FlatpickrInput < SimpleForm::Inputs::StringInput | |
def input(wrapper_options) | |
template.content_tag(:div, class: "input-group", | |
data: {controller: "flatpickr", flatpickr_disable_mobile: true}) do | |
template.concat input_addon(calendar_button, data: {toggle: true}) | |
template.concat @builder.text_field(attribute_name, input_html_options) | |
template.concat input_addon(close_button, data: {clear: true}) | |
end |
FROM ruby:3.0-alpine | |
RUN apk add --no-cache --update \ | |
ack \ | |
bash \ | |
build-base \ | |
curl \ | |
git \ | |
htop \ | |
less \ |
What if I told you that it's possible to get helpful failure messages from basic asserts
using idiomatic equality ==
checks? No DSLs in sight.
This is a proof of concept to demonstrate that it's possible... mostly to satisfy my own curiosity. The concepts here could theoretically be expanded to provide a useful extension to existing testing frameworks or perhaps lay a foundation for an entirely new one.
This experiment created with Ruby 3.0.1. Note to self: There's probably a way to do this with TracePoint
instead of monkey patching but I couldn't figure out how to get a reference to the passed variable being compared.