Skip to content

Instantly share code, notes, and snippets.

View version-control's full-sized avatar

version-control version-control

View GitHub Profile
@version-control
version-control / check for remote file existence c#
Last active December 18, 2021 08:51
Check for remote file existence c#
System.Net.HttpWebRequest request = null;
System.Net.HttpWebResponse response = null;
request = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create("www.example.com/somepath");
request.Timeout = 30000;
try
{
response = (System.Net.HttpWebResponse)request.GetResponse();
flag = 1;
@version-control
version-control / docker-compose.yml
Created January 12, 2021 16:30 — forked from soup-bowl/docker-compose.yml
Docker-compose LAMP dev stack
version: '3.6'
services:
db:
image: mysql:latest
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: e9w86036f78sd9
volumes:
- "./database:/var/lib/mysql"
db_pma:
@version-control
version-control / gist:a16b3a14bb603e1a43f2529181a7b492
Created January 6, 2021 16:28
Wordpress Change Login Image
// To be put in your functions file.
function my_login_logo_change() {
?>
<style type="text/css">
body.login div#login h1 a {
background-image: url(https://www.yourimageurl.com); //Add your own logo image in this url
padding-bottom: 30px;
}
</style>
<?php
@version-control
version-control / gist:6474b7282badbf543bbea20539fbbee7
Created January 6, 2021 16:26
Wordpress Force Login Function
// Redirect users who arent logged in...
// Add to your functions file.
function members_only() {
global $pagenow;
// Check to see if user in not logged in and not on the login page
if( !is_user_logged_in() && $pagenow != 'wp-login.php' )
auth_redirect();
}
add_action( 'wp', 'members_only' );
@version-control
version-control / mkvmerge-help-remove-audio-subtitle.txt
Last active December 4, 2020 14:34
mkvmerge exclude languages for audio and subs
Excluding language for audio and subs in mkv
set {audio} as any of these :
for english audio = -a "eng"
for english and french audio = -a "eng,fre"
set {subtitle} as any of these :
for english sub = -s "eng"
for english and french sub = -s "eng,fre"
for no sub (delete all) = --no-subtitles
to keep all subs, let variable empty.
@version-control
version-control / gist:d2b11972071211341506760af7f5a257
Created November 3, 2020 21:18 — forked from tmoitie/gist:9808555
Wordpress: Gravity Forms List to ACF Repeater post save
<?php
add_action('gform_after_submission', 'gfToAcfListToRepeater', 10, 2);
function gfToAcfListToRepeater($entry, $form)
{
foreach ($form['fields'] as $field) {
if (!($field['type'] == 'post_custom_field' && $field['inputType'] == 'list' && $field['enableColumns'] == true)) {
continue;
}
$id = $field['id'];
@version-control
version-control / index.html
Created May 7, 2020 12:37
video carousel - Bootstrap
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>video carousel - Bootstrap</title>
@version-control
version-control / bootstrap-3-carousel-fade-and-fullscreen.markdown
Created May 7, 2020 12:34
Bootstrap 3 carousel: Fade and fullscreen.