Skip to content

Instantly share code, notes, and snippets.

View luigisaggese's full-sized avatar

Luigi Saggese luigisaggese

  • Swatch Group
  • Switzerland
View GitHub Profile
@zengfenfei
zengfenfei / openApp.js
Last active August 4, 2021 15:18
Open native app from webpage, mobile safari "invalid address" warnings be suppressed when the app is not installed.
/*
Open native app through iframe so that mobile safari "invalid address" warnings be suppressed when the app is not installed.
* `window.location=url` will not open native app in the iframe of android chrome
* Android will go to the next page even if the url scheme is not supported
*/
function openApp (url) {
if (window.chrome && navigator.userAgent.search(/\bChrome\b/)!=-1) {
window.location = url;
} else {
@mikebluestein
mikebluestein / EffectsController.cs
Created July 8, 2014 22:19
iOS 8 Visual Effects using Xamarin
using System;
using System.Drawing;
using MonoTouch.UIKit;
namespace ViewEffectsDemo
{
public class EffectsController : UIViewController
{
UIImageView imageView;
UIScrollView scrollView;
@jberkus
jberkus / gist:6b1bcaf7724dfc2a54f3
Last active August 6, 2024 08:04
Finding Unused Indexes
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
using System.Collections.Generic;
using System.Drawing;
using MonoTouch.CoreAnimation;
using MonoTouch.CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.ImageIO;
using MonoTouch.UIKit;
namespace PuppyKittyOverflow.Touch
{
@Redth
Redth / Xamarin.Flurry.cs
Created May 9, 2013 19:04
Flurry analytics for Xamarin.iOS, Xamarin.Android, Windows Phone
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#if MONODROID
using Android.Telephony;
#endif
#if MONOTOUCH
using MonoTouch.Foundation;
@jdx
jdx / pg_perf.sql
Last active February 8, 2021 05:35
PostgreSQL performance queries
/* index performance */
SELECT
relname,
100 * idx_scan / (seq_scan + idx_scan) percent_of_times_index_used,
n_live_tup rows_in_table
FROM
pg_stat_user_tables
WHERE
seq_scan + idx_scan > 0
ORDER BY