Skip to content

Instantly share code, notes, and snippets.

View petrsvihlik's full-sized avatar
😋
Strategizing...

Petr Švihlík petrsvihlik

😋
Strategizing...
View GitHub Profile
@richlander
richlander / brotli-decompression.cs
Created May 7, 2018 15:55
Brotli Decompression
public static Stream DecompressWithBrotli(Stream toDecompress)
{
MemoryStream decompressedStream = new MemoryStream();
using (BrotliStream decompressionStream = new BrotliStream(toDecompress, CompressionMode.Decompress))
{
decompressionStream.CopyTo(decompressedFileStream);
}
return decompressedStream;
}
@ChristopherJennings
ChristopherJennings / KenticoCloudHelper.tsx
Created July 24, 2017 14:34
Kentico Cloud TypeScript SDK property mapper
export function GetPascalCaseFromKenticoCloudName(name: string) {
let result = '';
let upperNext = false;
for (let i = 0; i < name.length; i++) {
let isSeparator = name[i] === '_';
if (i === 0 || isSeparator) {
upperNext = true;
@joshschmelzle
joshschmelzle / remove-gamebar-powershell-win10.md
Last active April 3, 2024 14:09
How to Remove the Xbox Game Bar with Powershell on Windows 10

You've probably stumbled upon this researching how to remove the Xbox Game Bar. This gist includes a few different methods you can try. Please note that some of these first options are probably not be available unless you are running an older version of Windows 10.

Uninstalling/Removing the Game Bar (old Windows 10 build GUI options)

(this is no longer an option on any recent Windows 10 build)

  1. Press Windows Key or click on the Start menu.
  2. Start typing Xbox or Game Bar, until you get the Xbox Game Bar app to appear in the results.
  3. Right-click on the app and pick Uninstall. Answer Yes to the prompt, and wait for the process to finish.
@kentcdodds
kentcdodds / README.md
Last active October 27, 2015 13:41
One page site for First Timers Only concept

First Timers Only website idea

I wrote a blogpost on Medium last week about something I've been doing with my open source project. Check that out first: https://medium.com/@kentcdodds/first-timers-only-78281ea47455

It's had a fantastic response and people are enthusiastic about the idea. In an effort to encourage more projects to participate, I decided to file an issue on the up-for-grabs website repo and ask them if they would be willing to have a section dedicated to projects with first-timers-only issues.

If you checkout that issue, you see that Scott Hanselman has bought the domain firsttimersonly.com and wants to turn it into a one pager about the idea with links/resources/etc.

@FeodorFitsner
FeodorFitsner / install-vsix-appveyor.ps1
Created June 27, 2015 19:57
Installing VSIX extension from command line
$vsixPath = "$($env:USERPROFILE)\sqlite-wp81-winrt-3081002.vsix"
(New-Object Net.WebClient).DownloadFile('https://visualstudiogallery.msdn.microsoft.com/5d97faf6-39e3-4048-a0bc-adde2af75d1b/file/132406/15/sqlite-wp81-winrt-3081002.vsix', $vsixPath)
"`"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\VSIXInstaller.exe`" /q /a $vsixPath" | out-file ".\install-vsix.cmd" -Encoding ASCII
& .\install-vsix.cmd
@kurokikaze
kurokikaze / gist:350fe1713591641b3b42
Created October 3, 2014 11:40
install chrome from powershell
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
@crallen
crallen / SnakeCaseContractResolver.cs
Created February 26, 2014 20:46
Json.NET contract resolver that uses Ruby-style lowercase with underscore naming conventions.
using Newtonsoft.Json.Serialization;
namespace ConsoleApplication3
{
public class SnakeCaseContractResolver : DefaultContractResolver
{
protected override string ResolvePropertyName(string propertyName)
{
return GetSnakeCase(propertyName);
}
@HenrikFrystykNielsen
HenrikFrystykNielsen / SelfHostWithAssembliesResolver.cs
Created June 10, 2012 23:56
ASP.NET Web API: Controlling assemblies loaded by providing own AssembliesResolver
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Dispatcher;
using System.Web.Http.SelfHost;
namespace SelfHost
{
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@avar
avar / 30-income-calculon.pl
Last active February 12, 2024 18:34
Calculate your income in The Netherlands with and without a 30% ruling.
# To check if this is up-to-date with the tax rates go to
# http://www.expatax.nl/tax-rates-2016.php and see if there's anything
# newer there.
#
# I make no guarantees that any of this is correct. I calculated this
# at the time and have been updating it when new tax rates come along
# because people keep finding this useful.
#
# There's also an interactive JS version of this created by
# @stevermeister at