Skip to content

Instantly share code, notes, and snippets.

View sven-s's full-sized avatar

Sven Soennichsen sven-s

  • Germany, Hamburg
View GitHub Profile
@marco79cgn
marco79cgn / apple-availability-check.sh
Last active September 24, 2023 11:25
Bash script that checks whether an Apple product is available for pickup at your nearest Apple Store and sends a push notification if it gets available again (via ntfy.sh)
#!/bin/bash
partNo=$1
storeId=$2
notifyUrl=https://ntfy.sh/$3
FILE=$4/${partNo/\//-}-$storeId
if [ ! -f "$FILE" ]; then
echo "$FILE does not exist."
echo -n "1" > $FILE
fi
@mikestecker
mikestecker / optimising-unifi-performance.md
Last active April 22, 2024 13:32
optimising-unifi-performance

optimising-unifi-performance

NOTE: Content below is written by Adrian Mace. Click here for an updated version.

Below are the key settings that I apply on any unifi installation for optimal performance.

Settings

Settings > Site

  • Ensure Enable Advanced Features is enabled
    This allows you to follow along with the guide in it's entirety.
@jonlabelle
jonlabelle / msbuild-dotnet-aspnet-build.md
Last active March 22, 2024 16:23
Build, Publish and Deploy ASP.NET Web Applications from the Command Line
@junxy
junxy / Logstash-log4net-README.md
Last active July 14, 2020 07:15 — forked from dterziev/logstash.conf
Logstash 2.1.x config for log4net logs.
<!- .... ->
<log4net>    
    <appender name="RollingLogFileAppenderLogstash" type="log4net.Appender.RollingFileAppender">
      <encoding value="utf-8" />
      <!--该目录必需有 IIS用户 写权限-->
      <file value="X:/var/log/[app_name]/logfile.log" />
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
@aspnetde
aspnetde / upload-ipa-to-itunes-connect.sh
Created November 26, 2015 23:07
A small script that uses XCode's Application Loader to automatically submit an IPA to iTunes Connect
#!/bin/bash
set -ex
# Originally from https://gist.github.com/jedi4ever/b1f8b27d4a803d487fa4
# This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id
# Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status
# Requires application loader to be installed
# See https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html
@eclipsed4utoo
eclipsed4utoo / resize.cs
Last active December 16, 2021 14:18
Xamarin.Android Rotate and Resize
public static System.IO.Stream ResizeAndRotate(string filePath, int maxWidth, int maxHeight, float jpegQuality)
{
// loads just the dimensions of the file instead of the entire image
var options = new BitmapFactory.Options { InJustDecodeBounds = true };
BitmapFactory.DecodeFile (filePath, options);
int outHeight = options.OutHeight;
int outWidth = options.OutWidth;
int inSampleSize = 1;
@mgedmin
mgedmin / gist:9547214
Created March 14, 2014 12:59
Setting up a Jenkins slave on Linux
# This is how you add a Jenkins slave
# On master:
sudo -u jenkins -H ssh-keygen
# On slave
adduser --system --group --home=/var/lib/jenkins-slave --no-create-home --disabled-password --quiet --shell /bin/bash jenkins-slave
install -d -o jenkins-slave -g jenkins-slave /var/lib/jenkins-slave
@jfoshee
jfoshee / ListPickerViewModel.cs
Created March 22, 2013 19:20
Implementation of MonoTouch (Xamarin.iOS) UIPickerViewModel for an IList<T>.
namespace Unplugged
{
public abstract class ListPickerViewModel<TItem> : UIPickerViewModel
{
public TItem SelectedItem { get; private set; }
IList<TItem> _items;
public IList<TItem> Items
{
get { return _items; }
@miklund
miklund / gist:3838023
Created October 5, 2012 04:07
FAKE ExecProcess build target example
let fslex = @"packages\FSPowerPack.Community.2.1.3.1\Tools\fslex.exe"
let parserDir = @".\LiteMedia.Dsl\"
// FsParse
Target "FsYacc" (fun _ ->
let result =
ExecProcess (fun info ->
info.FileName <- fsyacc
info.Arguments <- parserDir + "parser.fsy --module Parser"
) (System.TimeSpan.FromMinutes 1.)
@jferguson
jferguson / gist:2047357
Created March 15, 2012 22:22
Query an EF View with SqlQuery<T>
[TestFixture]
public class QuerySomeView
{
[Test]
public void DoIt()
{
var context = new StoreContext();
var results = context.Database.SqlQuery<ReadModel>("SELECT * FROM SomeView").ToList();
Assert.AreEqual(results.Count(), 2);
}