Skip to content

Instantly share code, notes, and snippets.

View teamday's full-sized avatar
🍍
I may be slow to respond.

Roman S teamday

🍍
I may be slow to respond.
View GitHub Profile
@teamday
teamday / remove_crw.cmd
Last active May 17, 2016 08:21 — forked from xvitaly/remove_crw.cmd
Remove telemetry updates for Windows 7 and 8.1
@echo off
start /w wusa /uninstall /kb:971033 /quiet /norestart
start /w wusa /uninstall /kb:2902907 /quiet /norestart
start /w wusa /uninstall /kb:2952664 /quiet /norestart
start /w wusa /uninstall /kb:2990214 /quiet /norestart
start /w wusa /uninstall /kb:2976987 /quiet /norestart
start /w wusa /uninstall /kb:2976978 /quiet /norestart
start /w wusa /uninstall /kb:2902907 /quiet /norestart
start /w wusa /uninstall /kb:2952664 /quiet /norestart
@teamday
teamday / TrimLastWord.cs
Last active November 2, 2017 20:08
Trim last wrod regexp "Blah Blah Blah Bl..." -> "Blah Blah Blah..."
using System.Text.RegularExpressions;
public static class TrimLastWord{
private static Regex _trimLastWord = new Regex(@"\s+?(\S+)?$");
private static string TrimLastWord(this string str, int maxLength, string extra="...")
{
if (str?.Length > maxLength)
return $"{_trimLastWord.Replace(str.Substring(0, maxLength), "")}{extra}";
return str;
}
@teamday
teamday / backup_www_db.sh
Last active November 4, 2017 08:41
www & db backup script
DATE=`date +%F`
mysqldump --defaults-file=/root/.my.web1.cnf -h 10.13.0.4 -u username dbname | gzip -9 > /backup/dbname-${DATE}.sql.gz
cd /srv/www/
tar cf - webstie1folder | gzip -9 > /backup/website1-${DATE}.tar.gz
@teamday
teamday / docker-install.sh
Created November 12, 2017 18:43
Debian jessie docker install
# https://www.linuxbabe.com/linux-server/install-docker-on-debian-8-jessie-server
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo debian-jessie main" > /etc/apt/sources.list.d/docker.list
apt-get install apt-transport-https ca-certificates
apt-get update && sudo apt-get install docker-engine
systemctl start docker
systemctl enable docker
systemctl status docker
@teamday
teamday / config.txt
Last active May 3, 2019 22:34
rpi3 config.txt append console optimization
dtparam=audio=off
dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt
disable_splash=1
disable_audio_dither=1
gpu_mem=16
max_usb_current=1
#arm_control=0x200
System.ArgumentException: The specified ITextSnapshot doesn't belong to the correct TextBuffer.

at Microsoft.VisualStudio.Text.SnapshotSpan.TranslateTo(ITextSnapshot targetSnapshot, SpanTrackingMode spanTrackingMode)

at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<SetMouseCursorAndNavigableSpanHelperAsync>d__32.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<SetMouseCursorAndNavigableSpanHelperAsync>d__32.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.VisualStudio.Lang
$('.collapsible').collapsible();
$('.collapsible > li.disabled').parent().off('click.collapse', '.collapsible-header');
$('.collapsible > li.disabled > .collapsible-header').off('click.collapse').css('pointer-events', 'none');
<ul class="collapsible">
<li class="disabled">
<div class="row collapsible-header">
</div>
<div class="collapsible-body">
@teamday
teamday / CQRS_CQS_Learning.cs
Created February 14, 2018 02:06
CQRS_CQS_Learning
using System;
using System.Collections.Generic;
using System.Linq;
namespace CQRS_CQS_Learning
{
class Program
{
public class Person
public class StringValue : System.Attribute
{
private string _value;
public StringValue(string value)
{
_value = value;
}
public string Value
internal class ByteArrayEquityComparer : IEqualityComparer<byte[]>
{
public bool Equals(byte[] x, byte[] y)
{
if (x == null || y == null)
{
return x == y;
}
return UnsafeCompare(x, y);
}