Skip to content

Instantly share code, notes, and snippets.

View Snaver's full-sized avatar
🏠
Working from home

Richard Snaver

🏠
Working from home
View GitHub Profile
@Snaver
Snaver / import-news.ps1
Last active February 20, 2023 15:49
SharePoint Online News Import PowerShell Script
function Create-Slug {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$InputString
)
# Use a regular expression to remove any characters that are not letters, numbers, or dashes
$slug = $InputString -replace '[^\w-]', ''
@Snaver
Snaver / Detect.ps1
Last active February 20, 2023 15:50
Google Chrome Uninstaller - PowerShell (Local install)
# Based on https://sccmentor.com/2021/01/11/using-proactive-remediations-to-remove-google-chrome/
# Thank you.
try
{
$chromeInstalled = Test-Path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe'
if ($chromeInstalled -eq 'True') {
Write-Host "Google Chrome is installed locally"
@yajra
yajra / DataTable.vue
Last active July 25, 2023 11:06
VueJS DataTables Snippets with Delete Button Component
<template>
<table>
<thead>
<tr>
<th v-for="column in parameters.columns" v-html="title(column)"></th>
</tr>
</thead>
<tfoot v-if="footer">
<tr>
<th v-for="column in parameters.columns" v-html="column.footer"></th>
@Snaver
Snaver / instructions.md
Last active January 2, 2018 23:38
Add PHP 7.1 to Ubuntu 14.04 Install (Default setup of mod_php 5.6 & Apache 2.4.7)

Add PHP 7.1 to Ubuntu 14.04 Install (Default setup of mod_php 5.6 & Apache 2.4.7)

https://wiki.apache.org/httpd/PHP-FPM

Steps

  • libapache2-mod-fastcgi isn’t free software so include separate repo
    • add-apt-repository multiverse
  • apt-get update
@justjanne
justjanne / Price Breakdown.md
Last active April 11, 2024 22:21 — forked from kylemanna/price.txt
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price
@JacobBennett
JacobBennett / blog.md
Last active October 21, 2023 17:30
Clean up your Vue modules with ES6 Arrow Functions

Recently when refactoring a Vue 1.0 application, I utilized ES6 arrow functions to clean up the code and make things a bit more consistent before updating to Vue 2.0. Along the way I made a few mistakes and wanted to share the lessons I learned as well as offer a few conventions that I will be using in my Vue applications moving forward.

The best way to explain this is with an example so lets start there. I'm going to throw a rather large block of code at you here, but stick with me and we will move through it a piece at a time.

<script>

// require vue-resource...

new Vue({
@chrisjlee
chrisjlee / delete-feature-branches.sh
Last active March 30, 2022 21:51
Delete feature branch with prefix locally then remove all remote feature branches
# Stole from:
# http://stackoverflow.com/questions/32122784/alias-script-to-delete-all-local-and-remote-git-branches-with-a-specific-prefix
git branch -D $(printf "%s\n" $(git branch) | grep 'feature/')
# Or this will work too to remove all remote branches:
# https://coderwall.com/p/eis0ba/remove-a-thousand-stale-remote-branches-on-git
git branch -r | awk -F/ '/\/feature/{print $2}' | xargs -I {} git push origin :{}
# Prune all origin branches
git remote prune origin
@harrygr
harrygr / Envoy.blade.php
Last active January 19, 2023 23:06
Envoy deploy script for Laravel
{{--
INSTRUCTIONS
1. On your local/build/deployment system:
- Ensure Laravel Envoy is installed on your deployment box (local computer, build server etc - not your production server).
(see https://laravel.com/docs/5.2/envoy)
- Set up a certificate or ssh config such that you can ssh to your production server without prompt.
- Update the @servers array below with your production ssh details or ssh config.
- Update the $php variable to represent the php app server for your server.
<?php
$file = new Core\File\RemoteFile('http://bestclipartblog.com/clipart-pics/food-clip-art-6.png');
// Check if exists:
var_dump($file->exists());// bool(true)
// Get HTTP Status Code
var_dump($file->getHttpStatus()); // int(200)
@UniIsland
UniIsland / list-manually-installed-packages.sh
Created February 8, 2014 08:20
List all manually installed packages on a debian/ubuntu system
#!/bin/bash
## List all manually installed packages on a debian/ubuntu system
## manually installed means:
## 1. not pre-installed with the system
## 2. not marked auto-installed by apt (not dependencies of other
## packages)
## Note: pre-installed packages that got updated still needs to be
## filtered out.