Skip to content

Instantly share code, notes, and snippets.

@chintak
chintak / install_simplecv.sh
Last active June 1, 2018 15:56
Install SimpleCV/OpenCV in a Virtual Environment on Mac OSX
# First install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
# Choose the name of the virtualenv as simplecv
virtualenv simplecv --no-site-packages
source simplecv/bin/activate
# This activates the virtualenv; your command prompt should change from `$` to `(simplecv)$`
# Next the dependencies
sudo easy_install pip # Can be ignored, if pip already present
@lgarron
lgarron / copyToClipboard.html
Last active December 20, 2023 12:53
Simple `navigator.clipboard.writeText()` polyfill.
<script>
// A minimal polyfill for copying text to clipboard that works most of the time in most capable browsers.
// Note that:
// - You may not need this. `navigator.clipboard.writeText()` works directly in all modern browsers as of 2020.
// - In Edge, this may call `resolve()` even if copying failed.
// - In Safari, this may fail if there is nothing selected on the page.
// See https://github.com/lgarron/clipboard-polyfill for a more robust solution.
//
// License for this Gist: public domain / Unlicense
function writeText(str) {
@laracasts
laracasts / modal.blade.php
Last active January 28, 2022 00:13
Modals with Zero JavaScript
<div id="{{ $name }}" class="overlay">
<a href="#" class="cancel"></a>
<div class="modal">
{{ $slot }}
<a href="#" class="close">&times;</a>
</div>
</div>
// TODO: make `pages` optional and measure the div when unspecified, this will
// allow more normal document flow and make it easier to do both mobile and
// desktop.
import {
createContext,
useCallback,
useContext,
useEffect,
useMemo,
useRef,