Skip to content

Instantly share code, notes, and snippets.

@papsl
papsl / idea.md
Last active October 2, 2015 14:26
live gist - idea

Using placeholders (inspired by SublimeText snippets)

curl https://api.github.com/users/${0:git user name}/gists --insecure

curl https://api.github.com/users/${0:git user name}/gists --insecure

Using handlebars

@papsl
papsl / Value cannot be null Parameter name: browser.md
Last active October 10, 2015 13:58
Cordova: $exception {"Value cannot be null.\r\nParameter name: browser"} System.ArgumentNullException on Windows Phone

Error:

$exception	{"Value cannot be null.\r\nParameter name: browser"}	System.ArgumentNullException

Reason: config.xml

  <preference name="SplashScreenDelay" value="0" />
@papsl
papsl / fix-wordpress-permissions.sh
Last active November 13, 2015 20:34 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@papsl
papsl / ionic.html
Last active February 24, 2019 18:39
Ionic Latest HTML - just start HTML coding with Ionic without building entire App
<!DOCTYPE html>
<html>
<head>
<link href="https://unpkg.com/@ionic/core@latest/css/ionic.bundle.css" rel="stylesheet">
<script src="https://unpkg.com/@ionic/core@latest/dist/ionic.js"></script>
<script src="https://unpkg.com/ionicons@latest/dist/ionicons.js"></script>
</head>
<body>
<ion-app>
<ion-content>
@papsl
papsl / xmlsort.ps1
Created April 12, 2019 09:01
Sorts an XML file by element and attribute names, removes not needed empty tags. Useful for diffing XML files.
<#
.SYNOPSIS Sorts an XML file by element and attribute names, removes not needed empty tags. Useful for diffing XML files.
.NOTES
Original https://danielsmon.com/2017/03/10/diff-xml-via-sorting-xml-elements-and-attributes/
Last change: Peter Pirc (remove empty end tag)
Licence Public domain
#>
param (
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
@papsl
papsl / tSQLt.PrepareTableForFaking.sql
Last active May 28, 2019 09:51
tSQLt prepare table for faking
/*
Source: http://harouny.com/2013/04/19/tsqlt-taketable-indexed-view/
Description: With small modifications on REPLACE part and code style improvments
*/
CREATE PROCEDURE [tSQLt].[PrepareTableForFaking]
@TableName NVARCHAR(MAX),
@SchemaName NVARCHAR(MAX)
AS
BEGIN