Skip to content

Instantly share code, notes, and snippets.

// http://www.ruanyifeng.com/blog/clipboard/
var as = $('.module-list').querySelectorAll('a')
as = [].slice.call(as)
as = as.map(el => el.href)
var obj = {}
as.reduce((promise, item) => {
return promise.then(() => {
return fetch(item).then(res => res.text()).then(res => {
@quagliero
quagliero / README.md
Last active February 23, 2023 06:07
Installing cpuminer-multi on macOS 10.13.2 (High Sierra)

Installing cpuminer-multi on macOS 10.13.2 (High Sierra)

This assumes you have brew installed and are comfortable using a terminal.

Following the guide on https://github.com/tpruvot/cpuminer-multi will likely lead to errors about invalid paths to OpenSSL, and neoscrypt errors to the tune of Undefined symbols for architecture x86_64 during the build. I managed to piece together different fixes into an installation that has worked for me. So I hope it works for you.

Requirements

Ensure a c compiler is installed. Type g++ in the terminal and continue with the xcode installation if necessary. If it prints clang: error: no input files, then you can proceed.

@sealocal
sealocal / yarn.config
Last active May 14, 2021 12:16
Install Yarn and NodeJS on AWS Elastic Beanstalk EC2 Instance with Amazon Linux Ruby Platform, prior to precompiling assets for a Rails app
files:
# If this file is edited, it must be removed from EC2 instance prior to deploy.
"/opt/elasticbeanstalk/hooks/appdeploy/pre/09_yarn_install.sh" :
mode: "000775"
owner: root
group: users
content: |
#!/usr/bin/env bash
set -xe
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active April 25, 2024 04:16
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@tenderlove
tenderlove / mt_complete.rb
Last active December 11, 2020 19:56
tab completion for minitest tests
#!/usr/bin/env ruby --disable-gems
# Tab completion for minitest tests.
#
# INSTALLATION:
#
# 1. Put this file in a directory in your $PATH. Make sure it's executable
# 2. Run this:
#
# $ complete -o bashdefault -f -C /path/to/this/file.rb ruby
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@gringocl
gringocl / flash.html.erb
Created January 28, 2014 20:31
Rails flash message integration with zurb foundation snippet
<% flashes = {notice: 'success', alert: 'standard', error: 'alert', secondary: 'info'} %>
<% flashes.each do |key, value| %>
<% if flash[key] %>
<%= content_tag :div, :data => { :alert => '' }, :class => "alert-box #{value} radius" do %>
<%= flash[key] %>
<%= link_to '&times;'.html_safe, '#', :class => 'close'%>
<% end %>
<% end %>
<% end %>
@vicomte
vicomte / succ.js
Last active December 21, 2015 15:09 — forked from devongovett/succ.js
/*
* An implementation of Ruby's string.succ method.
* By Devon Govett
*
* Returns the successor to str. The successor is calculated by incrementing characters starting
* from the rightmost alphanumeric (or the rightmost character if there are no alphanumerics) in the
* string. Incrementing a digit always results in another digit, and incrementing a letter results in
* another letter of the same case.
*
* If the increment generates a carry, the character to the left of it is incremented. This
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"