Skip to content

Instantly share code, notes, and snippets.

View Erutan409's full-sized avatar

Michael Keyser Erutan409

  • Grand Rapids, MI
View GitHub Profile
@Erutan409
Erutan409 / gitlab.rb
Last active August 2, 2024 19:12
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'
@Erutan409
Erutan409 / Clone-SvnToGit.ps1
Created February 3, 2021 00:38 — forked from JeffJacobson/Clone-SvnToGit.ps1
One-way clone from SVN to Git
<#
.SYNOPSIS
Clones an Subversion repository into a Git repository.
.DESCRIPTION
Clones a Subversion repository into a Git repository, for migrating from Subversion to Git.
This is a scripted version of the processed outlined here:
http://web.archive.org/web/20161107131841/https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git
.EXAMPLE
PS C:\> .\Clone-SvnToGit.ps1 https://example.com/path/to/svn/myrepo/trunk users.txt
This will clone the SVN repository at the given URL into a git repository folder called "myrepo",
@Erutan409
Erutan409 / lodash.matchone.js
Created April 4, 2019 21:21
Lodash matchOne mixin
(function (lodash) {
if (!lodash.hasOwnProperty('matchOne')) {
lodash.mixin(lodash, {
matchOne: function () {
var values = lodash(arguments).values(),
test = values.head(),
odd = values.drop(1).filter(function (_void, index) {
return index % 2 === 0;
}).reverse(),
@Erutan409
Erutan409 / constructor.name.polyfill.js
Last active May 7, 2022 01:05
IE Javascript Constructor Name Polyfill
(function () {
if (!Object.constructor.prototype.hasOwnProperty('name')) {
Object.defineProperty(Object.constructor.prototype, 'name', {
get: function () {
return this.toString().trim().replace(/^\S+\s+(\w+)[\S\s]+$/, '$1');
}
})
}
})();
@Erutan409
Erutan409 / gist:9f2a934466e09c0cfcfc6bae7c4c80ed
Created November 2, 2018 22:01 — forked from discordier/gist:ed4b9cba14652e7212f5
options for phpStorm @noinspection annotation
javascript
ES6ValidationInspection
JSAccessibilityCheckInspection
JSBitwiseOperatorUsageInspection
JSCheckFunctionSignaturesInspection
JSClosureCompilerSyntaxInspection
JSCommentMatchesSignatureInspection
JSComparisonWithNaNInspection
JSConsecutiveCommasInArrayLiteralInspection
@Erutan409
Erutan409 / gist:cb21f0f4967c2ce32258108c1f0b76a4
Created September 18, 2018 20:42 — forked from hissy/gist:7352933
[WordPress] Add file to media library programmatically
<?php
$file = '/path/to/file.png';
$filename = basename($file);
$upload_file = wp_upload_bits($filename, null, file_get_contents($file));
if (!$upload_file['error']) {
$wp_filetype = wp_check_filetype($filename, null );
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_parent' => $parent_post_id,
@Erutan409
Erutan409 / wp_insert_attachment_from_url.php
Created September 17, 2018 20:08 — forked from m1r0/wp_insert_attachment_from_url.php
WP: Insert attachment from URL
<?php
/**
* Insert an attachment from an URL address.
*
* @param String $url
* @param Int $parent_post_id
* @return Int Attachment ID
*/
function crb_insert_attachment_from_url($url, $parent_post_id = null) {
@Erutan409
Erutan409 / gist:0da019b0da9e56f2972c23d78d11404e
Created July 16, 2018 16:18 — forked from jimkutter/gist:1370525
List of US States in a PHP array
<?php
array(
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',
@Erutan409
Erutan409 / git_submodules.md
Created June 30, 2018 18:08 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@Erutan409
Erutan409 / grid-push-pull.less
Last active May 11, 2018 14:20 — forked from Evanion/grid-push-pull.less
Responsive push/pull for uikit
/* Small */
@media (min-width: 480px) {
[class*='uk-push-small-'],
[class*='uk-pull-small-'] { position: relative; }
/*
* Push
*/