Skip to content

Instantly share code, notes, and snippets.

View timramseyjr's full-sized avatar

Tim Ramsey timramseyjr

View GitHub Profile
@mfuzailzubari
mfuzailzubari / nginx.conf
Created June 27, 2018 12:31
NGINX RTMP Configurations
worker_processes auto;
events {
# Allows up to 1024 connections, can be adjusted
worker_connections 1024;
}
# RTMP configuration
rtmp {
server {
listen 1935; # Listen on standard RTMP port
@sulfo
sulfo / gist:ef94b4c9077a8d1013ff62a66778f53a
Created January 11, 2018 12:26
Homestead box update
# Start within ssh
dbexport
logout
homestead halt
vagrant box update
vagrant destory
vagrant up
homestead ssh
dbimport
@Kashkovsky
Kashkovsky / Logger.cs
Created November 15, 2017 15:29
C# Logger with log rotation
public abstract class Logger : IDisposable
{
private LogVerbosity _verbosity;
private Queue<Action> _queue = new Queue<Action>();
private ManualResetEvent _hasNewItems = new ManualResetEvent(false);
private ManualResetEvent _terminate = new ManualResetEvent(false);
private ManualResetEvent _waiting = new ManualResetEvent(false);
private Thread _loggingThread;
private static readonly Lazy<Logger> _lazyLog = new Lazy<Logger>(() => {
@yireo
yireo / .gitignore
Created July 16, 2017 11:11
Magento 2 gitignore file
# Metadata
/.buildpath
/.cache
/.metadata
/.project
/.settings
atlassian*
/nbproject
/sitemap
/.idea
@davelowensohn
davelowensohn / gist:98b386c58ba09c00fa552e00a47d93ab
Last active December 6, 2023 17:15 — forked from carolineschnapp/gist:9122054
Order form to use in a page or collection template.
{% comment %}
Source: https://gist.github.com/davelowensohn/98b386c58ba09c00fa552e00a47d93ab
Forked from: https://gist.github.com/carolineschnapp/9122054
If you are not on a collection page, do define which collection to use in the order form.
Use the following assign statement, replace 'your-collection-handle-here' with your collection handle.
{% assign collection = collections.your-collection-handle-here %}
Use the assign statement outside of this comment block at the top of your template.
{% endcomment %}
{% paginate collection.products by 100 %}
$.fn.moreless = function(options){
var settings = {
'showChar': 100,
'ellipsestext': "...",
'moretext': "Show more >",
'lesstext':"Show less"
};
if (options) {
$.extend(settings, options);
}
@vluzrmos
vluzrmos / paginate.php
Created July 20, 2016 14:31
Laravel Paginate Collection or Array
<?php
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
* @param int $perPage
* @param int $page
* @param array $options
*
* @return LengthAwarePaginator
@veganista
veganista / file.liquid
Created April 20, 2016 10:56
Debugging Objects in Shopify Templates
<script>console.log({{ product | json }});</script>
@carolineschnapp
carolineschnapp / gist:9122054
Last active October 25, 2024 16:31
Order form to use in a page or collection template.
{% comment %}
Source: https://gist.github.com/carolineschnapp/9122054
If you are not on a collection page, do define which collection to use in the order form.
Use the following assign statement, replace 'your-collection-handle-here' with your collection handle.
{% assign collection = collections.your-collection-handle-here %}
Use the assign statement outside of this comment block at the top of your template.
{% endcomment %}
{% paginate collection.products by 100 %}
@vxnick
vxnick / gist:380904
Created April 27, 2010 15:52
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',