Skip to content

Instantly share code, notes, and snippets.

View jenkoian's full-sized avatar
πŸ‘¨β€πŸ’»
Works on my machine

Ian Jenkins jenkoian

πŸ‘¨β€πŸ’»
Works on my machine
View GitHub Profile
@nathansmith
nathansmith / react_101.md
Last active June 18, 2021 19:28
React 101β„’

React 101β„’

All these examples do essentially the same thing.

return (
  <MyComponent
    something={something}
    somethingElse={somethingElse}
 &gt;
@jesstelford
jesstelford / 01-shape-up-to-kindle.md
Last active May 20, 2025 16:22
Read SHAPE UP by basecamp on a Kindle / reMarkable / eReader

Read Shape Up by basecamp on a kindle / reMarkable / eReader

Basecamp's new book Shape Up is now available online (https://basecamp.com/shapeup) to read page-by-page.

There is a .pdf version, but that's not the best format for Kindle / other eReaders. Instead, we can convert the page-by-page into an eReader friendly format.

Part 1: Convert to a single page

NOTE: This has only been tested on Chrome

@milescsmith
milescsmith / gist:2c4afcded739d38345f520a63d7357fa
Last active January 10, 2025 09:38
install python module from git where setup.py is in a subdirectory
pip install -e 'git://github.com/{ username }/{ reponame }.git@{ tag name }#egg={ desired egg name }&subdirectory={ subdir }'
or
pip install -e 'https://github.com/{ username }/{ reponame }.git@{ branch/tag name }#egg={ whatever }&subdirectory={ subdir }'
The key is those single quotes - without them, Bash ignores the subdirectory portion.
<?php
/*
Plugin Name: Fix WooCommerce Template Cache
Plugin URI: https://woocommerce.com
Description: This fixes some issues with WC's template caching on sites that use multiple containers, due to the entire path being cached. If the file does not exist, this script uses default WC logic (copy/pasted) to grab the correct templates.
Version: 1.0.0
Author: Julien Melissas
Author URI: https://julienmelissas.com
*/
add_filter('wc_get_template_part', function( $template, $slug, $name ) {
@svalo
svalo / docker-compose.yml
Created January 17, 2019 14:57
Docker compose for 3 elastic data node and 1 master + fess node
version: '2.2'
services:
elasticsearch1:
build: elastic-img
container_name: elasticsearch1
environment:
- cluster.name=docker-cluster-for-fess
- node.name=node1
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
@swalkinshaw
swalkinshaw / tutorial.md
Last active February 26, 2025 21:15
Designing a GraphQL API
@Nyholm
Nyholm / gist:317df136ded2087649d0c9c464285cb1
Last active August 15, 2023 21:16
Show who contributed to your vendors folder
# Install git fame
gem install git_fame
# Install all vendors with source
rm -rf vendor/*
composer update --prefer-source
# Do the calculations. This might take 30 minutes to complete.
rm output.txt
find ./vendor -type d -depth 2 ! -path "./vendor/composer" -exec echo {} \; -exec git fame --sort=loc --hide-progressbar --repository={} \; >> output.txt
@oliveratgithub
oliveratgithub / emojis.json
Last active May 27, 2025 18:36
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘§", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "People & Body (family)", "order": ""},
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "People & Body (family)", "order": ""},
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘¦β€πŸ‘¦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "People & Body (family)", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "&#128104;&zwj;&#128105;&z
@houdmont
houdmont / levelling-up.js
Last active October 9, 2017 16:20
Levelling up a user.
function attemptLevelUp(addedXp, currentXp, currentLevel) {
var baseAmountForNextLevel = 0;
for (i = 1; i <= currentLevel; i++) {
baseAmountForNextLevel += xpNeededForNextLevel(i);
}
if ((currentXp + addedXp) >= baseAmountForNextLevel) {
// I am levelling up.
@lsmith77
lsmith77 / DoctrineMigrationTest.php
Last active July 27, 2023 19:12
PHPUnit functional test to check if migrations inside a Symfony app
<?php
namespace AppBundle\Tests;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\Tools\SchemaTool;
use Doctrine\DBAL\Driver\PDOMysql\Driver as MySQLDriver;
class DoctrineMigrationTest extends WebTestCase
{