Skip to content

Instantly share code, notes, and snippets.

@Korayem
Korayem / TrackEventsInGoogleAnalyticsAttribute.cs
Created June 4, 2012 15:58
A cool ActionFilter that when dropped over any controller or action, you got yourself google analytics event tracking! By default we assign controller name as category, and action name as the action. In the label we drop the user identity in case he/she i
using System.Configuration;
using System.Web.Mvc;
using GoogleAnalyticsTracker;
using SocialFruits.Domain;
using SocialFruits.Domain.Entities;
namespace SocialFruits.Extensions.Attributes
{
public class TrackEventsInGoogleAnalyticsAttribute : ActionFilterAttribute
{
XAML
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MobileApp.MyPage" xmlns:hsl="clr-namespace:mcpNetwork.Components.Forms;assembly=mcpnetwork.horizontalScrollLayout">
<ContentPage.Content>
<StackLayout Padding="0" Spacing="0">
<hsl:HorizontalScrollLayout x:Name="hscroll" HeightRequest="80" MultiSelection="false" ItemSelected="OnItemSelected">
<hsl:HorizontalScrollLayout.ItemTemplate>
<DataTemplate>
<ViewCell>
@Korayem
Korayem / update.bat
Created June 4, 2012 16:09
Easily upgrade nuget.exe in ".nugets" folder
nuget update -self
@Korayem
Korayem / migrate_rubocop_style_to_layout.rb
Last active January 10, 2019 11:30 — forked from wojtha/migrate_rubocop_style_to_layout.rb
Ruby script to migrate Rubocop settings from Style to Layout
# source: https://gist.github.com/wojtha/f97f45a6a09f14a58e5721fb178f2d3f
# Fixes complains such as:
# .rubocop.yml: Style/IndentationConsistency has the wrong namespace - should be Layout
# .rubocop.yml: Style/IndentationWidth has the wrong namespace - should be Layout
# .rubocop.yml: Style/DotPosition has the wrong namespace - should be Layout
layouts = %w[
AccessModifierIndentation
AlignArray
AlignHash
@Korayem
Korayem / searchGitBranchWithJiraIssue.sh
Last active March 27, 2019 12:29
search git commit message using jira issue key and return a list of branches that contain them, specifically: dev/staging/master branches to make sure they got merged properly
#!/bin/bash
# @korayem - 2019
# search git commit message using jira issue key and return a list of branches that contain them, specifically: dev/staging/master branches to make sure they got merged properly
# ./searchgit.sh PEG-1234 PEG-3214
# Returns something like this:
# PEG-1973 69df0fc238742acc099db85d799e05d7356b3f9b
# origin/HEAD -> origin/master
# origin/dev
# origin/master
@Korayem
Korayem / fix_exfat_drive.md
Created August 7, 2021 20:22 — forked from scottopell/fix_exfat_drive.md
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

Disk Utility is unable to repair this at first, but the fix is this:

  1. Use diskutil list to find the right drive id.
  2. You want the id under the IDENTIFIER column, it should look like disk1s1
  3. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  4. -d is debug so you'll see all your files output as they're processed.
  5. Answer YES if it gives you the prompt Main boot region needs to be updated. Yes/No?
@Korayem
Korayem / patch_apk_for_sniffing.md
Created August 9, 2021 10:10 — forked from unoexperto/patch_apk_for_sniffing.md
How to patch Android app to sniff its HTTPS traffic with self-signed certificate

How to patch Android app to sniff its HTTPS traffic with self-signed certificate

  • Download apktool from https://ibotpeaches.github.io/Apktool/
  • Unpack apk file: java -jar /home/expert/work/tools/apktool.jar d net.flixster.android-9.1.3@APK4Fun.com.apk
  • Modify AndroidManifest.xml by adding android:networkSecurityConfig="@xml/network_security_config" attribute to application element.
  • Create file /res/xml/network_security_config.xml with following content:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config>