Skip to content

Instantly share code, notes, and snippets.

View jjmpsp's full-sized avatar
💭
Working on a new personal website

Joel Murphy jjmpsp

💭
Working on a new personal website
View GitHub Profile

How to set up a new Production Server running Node on Ubuntu

START

Always start with an Update:

$ sudo apt-get update

Create folder for project:

$ mkdir production
@Phlow
Phlow / jeykll-post-counter.liquid
Last active November 22, 2019 00:27
Counter: This code snippet just counts your jekyll posts and spits out the result
{% comment %}
*
* Counter: This include counts your jekyll posts
*
{% endcomment %}{% assign counter = 0 %}{% for item in site.posts %}{% unless item.published == false %}{% assign counter=counter | plus:1 %}{% endunless %}{% endfor %}{{ counter }}
@georgiecel
georgiecel / wp-comment-walker
Last active December 28, 2022 15:16
Custom comment walker for HTML5 friendly WordPress comment and threaded replies. To be inserted in functions.php.
<?php
class comment_walker extends Walker_Comment {
var $tree_type = 'comment';
var $db_fields = array( 'parent' => 'comment_parent', 'id' => 'comment_ID' );
// constructor – wrapper for the comments list
function __construct() { ?>
<section class="comments-list">
@dsamarin
dsamarin / UndoStack.js
Created July 5, 2012 00:37
Easy undo-redo in JavaScript.
function UndoItem (perform, data) {
this.perform = perform;
this.data = data;
}
/**
* UndoStack:
* Easy undo-redo in JavaScript.
**/
@jdennes
jdennes / LICENSE
Last active March 7, 2024 04:40
Subscribing to a Campaign Monitor list using AJAX
The MIT License (MIT)
Copyright (c) James Dennes
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@BrendonKoz
BrendonKoz / leaflet-darkmode.md
Last active March 19, 2024 08:29
Automatic Dark Mode for Leaflet.js
// Leaflet JS - note the *className* attribute
// [...]

L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
    className: 'map-tiles'
}).addTo(map);

// [...]
@pamelafox
pamelafox / superbowls.sql
Created March 20, 2020 16:40
Superbowls 1967-2020 (Winners and losers of all Superbowl finals)
CREATE TABLE superbowls(
Date TEXT PRIMARY KEY,
SB TEXT,
Winner TEXT,
Winner_Pts INTEGER,
Loser TEXT,
Loser_Pts INTEGER,
MVP TEXT,
Stadium TEXT,
City TEXT,
@pamelafox
pamelafox / nba_players.sql
Created March 20, 2020 18:17
NBA players of the week
/*
Source:
https://www.kaggle.com/jacobbaruch/nba-player-of-the-week
*/
CREATE TABLE players(
Player TEXT,
Team TEXT,
Conference TEXT,
Date TEXT,
Position TEXT,
@pamelafox
pamelafox / top_movies.sql
Last active April 4, 2024 06:39
Top 100 Movies
/* Source: http://www.boxofficemojo.com/alltime/world/ */
CREATE TABLE topmovies(
Rank INTEGER,
Title TEXT,
Studio TEXT,
Worldwide REAL,
Domestic REAL,
DomesticPct REAL,
Overseas REAL,
OverseasPct REAL,
@pamelafox
pamelafox / solar_system_objects.sql
Last active April 4, 2024 06:41
solar_system_objects.sql
/*
Solar system objects
Adapted from: http://en.wikipedia.org/wiki/List_of_Solar_System_objects_by_size
Collected by: https://www.khanacademy.org/profile/patrick809/programs
*/
CREATE TABLE solar_system_objects(
body TEXT
, mean_radius NUMERIC /* km */
, mean_radius_rel NUMERIC /* relative to earth */
, volume NUMERIC /* 10^9 km^3 */