Skip to content

Instantly share code, notes, and snippets.

View shawmanz32na's full-sized avatar

Kevin Shaw shawmanz32na

  • G2 Software Systems, Inc.
  • Issaquah, WA
View GitHub Profile
@nobusugi246
nobusugi246 / gitlab-api.ps1
Last active April 27, 2024 20:07
GitLab API with PowerShell.
# https://docs.gitlab.com/ee/api/projects.html
# https://docs.gitlab.com/ee/api/issues.html
# https://docs.gitlab.com/ee/api/notes.html
# Project List
$r = Invoke-RestMethod -Headers @{ 'PRIVATE-TOKEN'='xxxxx' } -Uri http://xxxxx/api/v4/projects/
$r | Sort-Object -Property id | Format-Table -Property id, name
# Issues List
$r = Invoke-RestMethod -Headers @{ 'PRIVATE-TOKEN'='xxxxx' } -Uri http://xxxxx/api/v4/projects/<xx>/issues
@AgentOak
AgentOak / youtube_formats.md
Last active May 9, 2024 17:31
Youtube Format IDs

Last updated: April 2021

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

Resolution AV1 HFR High AV1 HFR AV1 VP9.2 HDR HFR VP9 HFR VP9 H.264 HFR H.264
MP4 MP4 MP4 WebM WebM WebM MP4 MP4
@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({
@atoa
atoa / docker-mount.sh
Last active September 10, 2019 13:36
#!/usr/bin/env bash
# Docker for Windows drive mount helper
# Manually mounts a Windows shared drive inside the MobyLinuxVM virtual machine
# (host running on HyperV) so that it is visible to Docker containers.
# It enters the moby VM using nsenter via the 'docker4w/nsenter-dockerd'
# container.
# Then mounts the share drive using the DockerNAT ip address
# This can be useful with unix like environments under Windows
@msmfsd
msmfsd / es7-async-await.js
Last active February 4, 2024 17:38
Javascript fetch JSON with ES7 Async Await
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved
@alvarow
alvarow / print-headers.jsp
Last active April 10, 2020 20:13
Print HTTP request headers in JSP
<%@ page import="java.util.*" %>
<html>
<head>
<title>Http Request Headers Example in JSP</title>
</head>
<body>
<h2>HTTP Request Headers Received</h2>
<table>
@jpoehls
jpoehls / example.ps1
Created April 28, 2015 14:45
Symlink support in PowerShell V5 *-Item cmdlets
### SYMBOLIC LINK FILES
# Create a new symbolic link file named MySymLinkFile.txt in C:\Temp which links to $pshome\profile.ps1
cd C:\Temp
New-Item -ItemType SymbolicLink -Name MySymLinkFile.txt -Target $pshome\profile.ps1 # File
# Target is an alias to the Value parameter
# Equivalent to above
New-Item -ItemType SymbolicLink -Path C:\Temp -Name MySymLinkFile.txt -Value $pshome\profile.ps1
# Equivalent to above
@tracker1
tracker1 / 01-directory-structure.md
Last active May 4, 2024 19:55
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@bastosmichael
bastosmichael / gitlab6.5.sh
Last active August 29, 2015 13:55
Gitlab 6.5 Ubuntu Installer
#!/bin/bash
if [ $# -eq 0 ]
then
echo "gitlab.sh [options] postgres|mysql|restart
postgres - Automatically install gitlab with postgres on ubuntu
mysql - Automatically install gitlab with mysql on ubuntu (Not Finished)"
elif [ $1 == 'postgres' ]; then
@bastosmichael
bastosmichael / etc-network-interfaces
Last active December 30, 2015 12:39
Ubuntu NAT setup between eth0 and eth1
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static