Skip to content

Instantly share code, notes, and snippets.

View Toumash's full-sized avatar

Tomasz Dłuski Toumash

View GitHub Profile
@Toumash
Toumash / gitProp
Created April 25, 2015 06:51
Pretty Git
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
OR
git log --oneline --abbrev-commit --all --graph --decorate --color
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace zaliczenie
{
class Program
{
/**
* ten skrypt moze zostac uzyty na raporcie SWE
* platformy webcon wstawiajac go na strone jako element html
*
* ! UWAGA !
* Nie był on na serio testowany i moga w wnim wystepowac bugi
*
* TODO:
* przy odswiezaniu updatepanelu nie dodawaj powtornie nowego
* elementu tylko dodaj flagle dodania poprzedniego i ja sprawdzaj
@Toumash
Toumash / create_log_table.sql
Created July 8, 2019 05:33
Nlog database (SQL Server) logging in Sharepoint environment (you cannot use nloc.config) Author: Bartosz Kusiak
CREATE TABLE [dbo].[Log] (
[Id] [int] IDENTITY(1,1) NOT NULL,
[Application] [nvarchar](50) NOT NULL,
[Logged] [datetime] NOT NULL,
[Level] [nvarchar](50) NOT NULL,
[Message] [nvarchar](max) NOT NULL,
[Logger] [nvarchar](250) NULL,
[Callsite] [nvarchar](max) NULL,
[Exception] [nvarchar](max) NULL,
CONSTRAINT [PK_dbo.Log] PRIMARY KEY CLUSTERED ([Id] ASC)
@Toumash
Toumash / FetchListsForWebPartPropsDropdown.ts
Created September 21, 2019 17:36 — forked from chrisobriensp/FetchListsForWebPartPropsDropdown.ts
Dynamically populate SPFX web part property dropdown list - using lists in current site. See http://cob-sp.com/SPFx-WP-Props2
/* need some imports e.g.:
import { IODataList } from '@microsoft/sp-odata-types';
import { SPHttpClient, SPHttpClientConfigurations, SPHttpClientConfiguration, SPHttpClientResponse, ODataVersion, ISPHttpClientConfiguration } from '@microsoft/sp-http';
*/
private dropdownOptions: IPropertyPaneDropdownOption[];
private listsFetched: boolean;
// these methods are split out to go step-by-step, but you could refactor and be more direct if you choose..
@Toumash
Toumash / polly-sample.cs
Created November 24, 2019 18:07
polly-example
var retryPolicy = Policy
.HandleResult<IRestResponse<RootObject>>(r => !r.IsSuccessful)
.Or<TimeoutRejectedException>()
.WaitAndRetryAsync(new[] { TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2)});
var response = await retryPolicy.ExecuteAsync(() =>
{
var client = new RestClient(\$"https://sample.api/api/search/nip/{line}?date=2019-11-15");
var request = new RestRequest(Method.GET);
return client.ExecuteTaskAsync<RootObject>(request);
https://docs.microsoft.com/en-us/microsoft-365/enterprise/modern-web-part-optimization?view=o365-worldwide
http://www.sharepointtweaks.com/2019/06/Modern-experience-optimizing-SPFx-components.html
Obrazki w sharepoincie - https://n8d.at/image-renditions-available-in-modern-team-sites/
@Toumash
Toumash / [RFC] Developerska wersja Webcon BPS Designer Studio.md
Last active February 9, 2022 19:43
Webcon Tooling for developerrs

1. Wstęp

Webcon to ogromne narzędzie klasy BPML do standaryzacji procesów biznesowych w firmach od małych zakładów aż do klasy Enterprise. Z narzędziem na codzień pracuje cała masa ludzi tworząc do niego różnego rodzaju dodatki, integracje. Jeśli kiedykolwiek pisałeś większą integrację do systemu webcon zapewne wiesz z jakimi problemami stykają się developerzy, którzy do tego systemu tworzą integracje na codzień . Wraz z wycofaniem wsparcia technologii komunikacji i integracji Webcon BPS a systemami zewnętrznymi o nazwie "SOAP", komunikacja z systemem webcon przestała podlegać pod standardy wyznaczane przez schematy XML. Aktualnie zastąpione zostały one standardem OpenAPI - który dość dobrze opisuje system, ale pod względem transportu, natomiast w systemie brak jakiejkolwiek wziamnki o logice importowania danych do różnych typów pól. Szczególny nacisk kładziemy na nowe, nieopisane typy, przez które integratory zwyczajnie

DECLARE @name VARCHAR(100) -- database name
DECLARE @SQLString nvarchar(200)
DECLARE db_cursor CURSOR FOR
SELECT name
FROM MASTER.dbo.sysdatabases
WHERE name NOT IN ('master','model','msdb','tempdb','spare-me','me-too')
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @name
use master

Linkedin un-motivate Chrome Extension

Each post is just a div with data-id, that appear and disappear as you scroll the feed.

To hide an activity you can just execute this oneliner in the console.

document.querySelector("[data-id='urn:li:activity:6866019474424827904'").hidden=true;