Skip to content

Instantly share code, notes, and snippets.

View drmzio's full-sized avatar

Daniel Ramirez drmzio

View GitHub Profile
@sammarks
sammarks / lambda.js
Created May 7, 2020 00:04
Slack notifications from AWS Amplify
const https = require('https')
exports.handler = async (event) => {
const sns = event.Records[0].Sns.Message
let color = ''
let message = ''
if (sns.includes('build status is FAILED')) {
color = '#E52E59'
message = 'Release to My Company **production** failed.'
} else if (sns.includes('build status is SUCCEED')) {
@drmzio
drmzio / Plugin.php
Last active February 13, 2022 09:47
October CMS RainLab.Blog media manager plugin extension
<?php
namespace Acme\BlogBanner;
use System\Classes\PluginBase;
use Event;
/**
* Class Plugin
*
@LukeTowers
LukeTowers / .0 - cheatsheet.sh
Last active February 6, 2023 20:58
Introduction to OctoberCMS
# Setup symlinks in local development copy of Winter to the local development copy of Winter.Workshop
ln -s ~/LocalRepositories/WinterCMS/Themes/Winter/Workshop ~/LocalRepositories/WinterCMS/Core/winter/themes/workshop
# Setup external symlink (for mac, outside of vagrant) to the local development copies of my plugins
ln -s ~/Repositories/WinterCMS/Themes/Winter/Workshop ~/Repositories/WinterCMS/Core/winter/themes/workshop-src
# Setup symlinks in local development copy of Winter to the local development copies of my plugins
ln -s ~/LocalRepositories/WinterCMS/Plugins ~/LocalRepositories/WinterCMS/Core/winter/plugins
# Setup external symlink (for mac, outside of vagrant) to the local development copies of my plugins
anonymous
anonymous / config.json
Created June 14, 2016 23:39
Bootstrap Customizer Config
{
"vars": {},
"css": [
"grid.less",
"responsive-utilities.less"
],
"js": []
}
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@albankora
albankora / LEMP_Laravel_config
Last active June 8, 2017 02:35
LEMP install and Laravel config
#make a folder for your app
mkdir /var/www
mkdir /var/www/laravel
#nginx config for laravel app
server {
listen 80 default_server;
root /var/www/laravel/public/;
index index.php index.html index.htm;
@kevinwhoffman
kevinwhoffman / loop-custom.php
Last active April 8, 2022 11:22
WordPress - Custom Post Type Loop
<?php
$loop = new WP_Query( array(
'post_type' => 'Property',
'posts_per_page' => -1
)
);
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@barryvdh
barryvdh / _ide_helper.php
Last active May 6, 2024 07:45
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",