Skip to content

Instantly share code, notes, and snippets.

View gist:a5cc1a9aa99a5622fd0be325ae1ca778
{% block content %}
<div class="row card-columns">
{% for i in index %}
<div class="col-12">
<div class="card my-5">
<h3 class="card-header">Choice {{ i }}</h3>
<div class="card-body px-5">
<div class="row card-deck">
{% for choice in form.choice_1 %}
<div class="card">
@matrixwd
matrixwd / downloads.php
Created Jul 16, 2017
Adding Custom Fields Version Number to WooCommerce Downloads page
View downloads.php
<?php break;
case 'download-product_version' :
$dl_id = $download['product_id'];
$version = esc_html( get_post_meta( $dl_id, 'version', true ) ); ?>
<span class="version"><?php echo $version; ?></span>
<?php break;
}
View gist:2ef54ea7a058f0c743109c1f1b3a0a34
{% block content %}
<div class="row card-columns">
{% for i in index %}
<div class="col-12">
<div class="card my-5">
<h3 class="card-header">Choice {{ i }}</h3>
<div class="card-body px-5">
<div class="row card-deck">
{% for choice in form.choice_1 %}
<div class="card">
View ledger_2019_09_17_15_54_56.sql
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
--
-- Host: localhost Database: nodetrinity
-- ------------------------------------------------------
-- Server version 5.7.27-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@richtan
richtan / vimrc
Last active Dec 7, 2019
My vim config
View vimrc
""" richtan's vimrc
let s:vimfiles_dir = $HOME . (has('win32') || has('win32unix') || has('wsl')
\ ? '/vimfiles/' : '/.vim/')
let &runtimepath = s:vimfiles_dir . ',' . &runtimepath
let g:mapleader = ','
if empty(getcwd())
silent! execute 'cd ' . $HOME
endif
@proxpero
proxpero / Permutations.swift
Last active Dec 7, 2019
Generate the permutations of a Swift array.
View Permutations.swift
//: Permutations
// based on https://www.objc.io/blog/2014/12/08/functional-snippet-10-permutations/
// but updated for Swift 2.0 (Xcode 7.0)
extension Array {
func decompose() -> (Generator.Element, [Generator.Element])? {
guard let x = first else { return nil }
return (x, Array(self[1..<count]))
}
}
View COUNTHAVING.sql
mysql> SELECT t.name team, COUNT(p.wizard_id) FROM player p INNER JOIN wizard w ON w.id=p.wizard_id INNER JOIN team t ON t.id=p.team_id group by team HAVING COUNT(p.wizard_id) > 14 order by team;
+------------+--------------------+
| team | COUNT(p.wizard_id) |
+------------+--------------------+
| Gryffindor | 36 |
| Ravenclaw | 15 |
| Slytherin | 21 |
+------------+--------------------+
3 rows in set (0.00 sec)
View recursive-timeouts.js
setTimeout(function run() {
console.log('Hello!');
setTimeout(run, 1000);
}, 1000);
@odikia
odikia / EmployeeSatisfaction.ipynb
Created Dec 7, 2019
Created on Cognitive Class Labs
View EmployeeSatisfaction.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.