This file contains hidden or 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
| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
This file contains hidden or 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
| package main | |
| import ( | |
| "encoding/csv" | |
| "fmt" | |
| "io" | |
| "log" | |
| "os" | |
| "reflect" |
This file contains hidden or 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
| <table> | |
| <colgroup> | |
| <col width="50"> | |
| <col width="50"> | |
| <col width="50"> | |
| <col width="50"> | |
This file contains hidden or 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
| #How to list all categories and their IDs using SQL query? | |
| SELECT t.name, t.slug, t.term_id, x.count, tt.name AS parent_name FROM wp_term_taxonomy AS x | |
| INNER JOIN wp_terms AS t ON t.term_id = x.term_id | |
| LEFT JOIN wp_terms AS tt ON tt.term_id = x.parent | |
| WHERE taxonomy = 'category' | |
| ORDER BY t.name |
This file contains hidden or 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
| #!/usr/bin/python3 | |
| """ | |
| Sort Photos by Month. | |
| install python3-pil | |
| """ | |
| import logging, datetime | |
| import argparse, os, sys | |
| import hashlib | |
| from PIL import Image |
This file contains hidden or 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 | |
| // $terms = wp_get_post_terms( get_the_id(), 'topics', array( 'orderby' => 'term_order' )); | |
| $terms = wp_get_post_terms( get_the_id(), 'category', array( 'orderby' => 'term_order' )); | |
| echo "<pre>"; | |
| print_r( $terms); | |
| get_permalink($id); |
This file contains hidden or 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 | |
| //https://wordpress.stackexchange.com/questions/43426/get-all-categories-and-posts-in-those-categories | |
| $args = array( | |
| 'posts_per_page' => -1 | |
| ); | |
| $query = new WP_Query($args); |
This file contains hidden or 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 $menus = get_registered_nav_menus(); | |
| foreach ( $menus as $location => $description ) { | |
| echo $location . ': ' . $description . '<br />'; | |
| } |
This file contains hidden or 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
| span.delete, | |
| span.delete, | |
| span.delete_media { | |
| position: absolute; | |
| top: 0; | |
| right: 0; | |
| display: none; | |
| cursor: pointer; | |
| z-index: 1; | |
| color: #555555; |
This file contains hidden or 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 class="no-js" lang="en-US"> | |
| <head> | |
| <script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script> | |
| <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/knockout/knockout-3.5.0.js"></script> | |
| <!-- <script src="model.js" type="text/javascript"></script> | |
| --> | |
| <script> |
NewerOlder