Created from the plain text reference card on orgmode.org Download this file, and open it in Emacs org-mode!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First, extract just the one table. | |
var table = document.querySelector("table"); | |
// Then get all the rows from that table. | |
var tableRows = table.querySelectorAll("tr"); | |
// I used `reduce` here, because the number of returned | |
// items might be different than the original array. | |
// It's probably possible to improve this. It was coded quickly. | |
var catArray = [...tableRows].slice(1).reduce((acc, row) => { | |
const el = row.querySelector("th[scope='row']"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Scrapes cat breed names from https://en.wikipedia.org/wiki/List_of_cat_breeds | |
// Run it in the browser console on that page. | |
var table = document.querySelector("table"); | |
var catNameArray = | |
[...table.querySelectorAll("th[scope='row']")] | |
.map((tr) => { | |
return tr | |
.innerText |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is just a sketch. Please leave a comment if you have suggestions. | |
class AuthController < ApplicationController | |
# Generate and SSO URL and redirect the user to Discourse | |
def authenticate | |
# Save the ?destination=some_url parameter if it exists | |
destination = request.query_parameters['destination'] || root_url | |
session[:destination] = destination | |
# `nonce` here will have `:value` and `:created_at` keys | |
nonce = generate_nonce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
from Blender to WebVR in 1 click (warning: you need your own backend but a 1 php file is enough) | |
demo https://www.youtube.com/watch?v=PD1qTKp5DZ4 | |
improvments | |
JS traverser to start/stop animations and change morph target values | |
render as 360 rather than mesh, either as an option and/or beyond a threshold | |
for addon proper https://docs.blender.org/manual/en/dev/advanced/scripting/addon_tutorial.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('mysql.php'); // see https://gist.github.com/paxmanchris/f5d4b94f67a8acd8cefc | |
$me = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; | |
$sso_secret = 'YOUR_SSO_PROVIDER_KEY_HERE'; | |
$discourse_url = 'http://example.com'; | |
if(!empty($_GET) and isset($_GET['sso'])){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @see http://editorconfig.org/ | |
# This is the top-most .editorconfig file; do not search in parent directories. | |
root = true | |
# All files. | |
[*] | |
end_of_line = lf | |
indent_style = space | |
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content=""> | |
<title>Website</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<title>Website</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | |
<title>Website</title> | |
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.6/semantic.min.css" /> |
NewerOlder