Skip to content

Instantly share code, notes, and snippets.

@Erutan409
Erutan409 / gitlab.rb
Last active April 20, 2024 21:50
Gitlab Nginx Reverse Proxy Configuration (with Let's Encrypt SSL)
# These are fragments of the configuration that will need to be updated
# ---
## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
external_url 'https://gitlab.your-fqdn.com'
#external_url 'http://gitlab.internal.lan'
@RyanNutt
RyanNutt / Jeroo.java
Last active September 3, 2018 22:11
Mockup of a Jeroo class file. See https://compsci.rocks/jeroo-demo-class-file/
public class Jeroo {
private int row;
private int column;
private int flowers;
public Jeroo() {}
public Jeroo(int flowers) {}
public Jeroo(int row, int col) {}
public Jeroo(int row, int col, int flowers) {}
@kellenmace
kellenmace / class-download-remote-image.php
Last active October 13, 2022 13:24
Download and Insert a Remote Image File into the WordPress Media Library
<?php
/**
* This class handles downloading a remote image file and inserting it
* into the WP Media Library.
*
* Usage:
* $download_remote_image = new KM_Download_Remote_Image( $url );
* $attachment_id = $download_remote_image->download();
*
@JakubPetriska
JakubPetriska / quotes.csv
Last active April 7, 2024 14:54
Motivational quotes
Author Quote
Thomas Edison Genius is one percent inspiration and ninety-nine percent perspiration.
Yogi Berra You can observe a lot just by watching.
Abraham Lincoln A house divided against itself cannot stand.
Johann Wolfgang von Goethe Difficulties increase the nearer we get to the goal.
Byron Pulsifer Fate is in your hands and no one elses
Lao Tzu Be the chief but never the lord.
Carl Sandburg Nothing happens unless first we dream.
Aristotle Well begun is half done.
Yogi Berra Life is a learning experience, only if you learn.
@Shelob9
Shelob9 / serve-side-block.js
Last active February 4, 2024 20:38
Example Gutenberg block with server-side rendering. Gutenberg edit() block creates interface. Gutenberg saves settings automatically, the PHP function passed as `render_callback` to `register_block_type` is used to create HTML for front-end rendering of block.
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const el = wp.element.createElement;
registerBlockType( 'hiRoy/serverSide', {
title: __( 'Server Side Block', 'text-domain' ),
icon: 'networking',
category: 'common',
attributes: {
@jbasdf
jbasdf / canvas_lti_variables
Created November 11, 2017 00:49
All Canvas LTI Variables for substitution
context_title: "$Context.title",
com_instructure_post_message_token: "$com.instructure.PostMessageToken",
com_instructure_assignment_lti_id: "$com.instructure.Assignment.lti.id",
com_instructure_originality_report_id: "$com.instructure.OriginalityReport.id",
com_instructure_submission_id: "$com.instructure.Submission.id",
com_instructure_file_id: "$com.instructure.File.id",
course_offering_sourced_id: "$CourseOffering.sourcedId",
context_id: "$Context.id",
context_sourced_id: "$Context.sourcedId",
message_document_target: "$Message.documentTarget",
@jeffochoa
jeffochoa / Response.php
Last active April 20, 2024 12:35
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@M165437
M165437 / ScheduleList.php
Last active November 27, 2022 12:20
PHP Artisan command that lists all scheduled tasks: php artisan schedule:list (Credit: https://stackoverflow.com/a/35559970/2714126)
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Console\Scheduling\Schedule;
class ScheduleList extends Command
{
/**
@cfebs
cfebs / vboxhostonlyssh.md
Last active October 22, 2023 12:32
setup a vbox ubuntu server with host only adapter

Virtualbox dev environment w/ static IP

I can never find a great guide on this stuff, so these are more like notes to myself.

The goal here is to have a virtualbox running more or less headless. An ssh client is used separately to actually use the machine. I've found it to be fantastic for a quick dev setup.

lets go

Assumes you have a vbox setup with Ubuntu server (this will work for 16.04) ready to go.

#!/bin/bash
# Anh Nguyen <anh.ng8@gmail.com>
# 2016-04-30
# MIT License
# This script takes in same-size images from a folder and make a crossfade video from the images using ffmpeg.
# Make sure you have ffmpeg installed before running.
# The output command looks something like the below, but for as many images as you have in the folder.