Skip to content

Instantly share code, notes, and snippets.

View deanbot's full-sized avatar

Dean Verleger deanbot

View GitHub Profile
#!/bin/sh
saywhat=$@
echo -n $'\E[0m'
echo $''
echo $''
echo $' /\\__/\\'
echo $' /` \'\\'
echo $' === 0 0 ==='
UPDATE wp_options SET option_value = replace(option_value, 'http://localhost:8888/wordpress', 'http://www.YOUR_SITE_URL.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE (guid, 'http://localhost:8888/wordpress', 'http://www.YOUR_SITE_URL.com');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://localhost:8888/wordpress', 'http://www.YOUR_SITE_URL.com');
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://localhost:8888/wordpress','http://www.YOUR_SITE_URL.com');
// include Columnizer-Jquery-Plugin
(function ($) {
$(document).ready(function ($) {
return (function () {
if (!Modernizr.csscolumns) { // eslint-disable-line no-undef
$('section.section-your-challenge-tabs .tab-content-sub ul').columnize({
columns: 2,
lastNeverTallest: true
});
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = 'http://yourdomain.com/script.js';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
})();
@deanbot
deanbot / Rename VS solution and projects in VSCode
Last active February 28, 2018 18:24
process for renaming visual studio solution and projects with vscode keyboard shortcuts
Close out of VS.
1. Open solution directory with VSCode - editor should not auto-run c# (if vs code don't activate c# extention)
2. rename solution file
3. For each project
1. Get name of old project (perhaps from the solution file).
1. Rename oldProject folder
2. Rename oldProject .csProj file
3. Find and replace all files in directory (if vs code right click > select 'Find in Folder' for any directory inside the solution directory and change Files to include to ./)
4. The following keyboard shortcuts after entering old project name in Search and new project name in Replace
@deanbot
deanbot / .vscode > settings.json for front end dev in .NET MVC project
Created February 28, 2018 18:33
Hide VS folders in .NET MVC project for es6 development
"files.exclude": {
"**/bin": true,
"**/obj": true,
"**/*.csproj": true,
"**/*.csproj.*": true,
"**/*.cs": true,
"**/node_modules": true,
"**/bower_components": true,
"**/Scripts": true,
"**/Models": true,
<!doctype html>
<html lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta charset='utf-8' />
<script>
function subst() {
// get query vars
var vars = {};
<style type="text/css" media="screen,print">
/* Page Breaks */
/***Always insert a page break before the element***/
.pb_before {
page-break-before: always !important;
}
/***Always insert a page break after the element***/
.pb_after {
@deanbot
deanbot / MyMergingFunction.cs
Last active August 19, 2019 19:55
cs azure function merging pdfs
using System.Text;
namespace MyFunction
{
public static class MyFunction
{
public static async Task<IActionResult> ItsMyFunction ()
{
// this is needed so that an encoding error is avoided when merging the 2 ca pdfs with PDFSharp
// https://gunnarpeipman.com/net/no-data-is-available-for-encoding/
@deanbot
deanbot / keepawake.ps1
Last active July 19, 2022 16:03 — forked from jamesfreeman959/keepawake.ps1
PowerShell script to keep a Windows PC awake
# PowerShell script to keep a Windows PC awake
Write-Host "Keeping PC awake... (send Ctrl+C to quit)"
while (1) {
$wsh = New-Object -ComObject WScript.Shell
$wsh.SendKeys('+{F15}')
Start-Sleep -seconds 59
}