Skip to content

Instantly share code, notes, and snippets.

View nukedbit's full-sized avatar
🏠
Working from home

Sebastian Faltoni nukedbit

🏠
Working from home
View GitHub Profile
@nukedbit
nukedbit / MenuListViewCellRenderer.cs
Created December 12, 2015 00:04
Xamarin Forms ListView Custom selection color
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using UIKit;
using CoreGraphics;
[assembly: ExportRenderer (typeof(MyApp.MenuListViewCell), typeof(MyApp.iOS.MenuListViewCellRenderer))]
namespace MyApp.iOS {
@nukedbit
nukedbit / gist:8531532
Last active January 3, 2016 22:59
enable remote touch support on freerdp
#Follow documentation on this link except for the cmake command and use the one below
https://github.com/FreeRDP/FreeRDP/wiki/Compilation
# compile using note -DWITh_XI=ON to enable touch redirection!
cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_SSE2=ON -DWITH_XI=ON .
make
# now install and enjoy!!
@nukedbit
nukedbit / TokenGenerator.cs
Created March 1, 2016 22:37
Generazione di token da username password
public class TokenGenerator
{
private const string Alg = "HmacSHA256";
public string Generate(string username, string password, string ip, string userAgent, long ticks)
{
string hash = string.Join(":", username, ip, userAgent, ticks.ToString());
string hashLeft = "";
string hashRight = "";
@nukedbit
nukedbit / BlogAuthenticationFilterAttribute.cs
Created March 1, 2016 22:40
BlogAuthenticationFilterAttribute
public class BlogAuthenticationFilterAttribute : Attribute, IAuthenticationFilter
{
private readonly Rights? _rights;
public BlogAuthenticationFilterAttribute(Rights rights)
{
_rights = rights;
}
public BlogAuthenticationFilterAttribute()
{
@nukedbit
nukedbit / genymotionwithplay.txt
Created August 10, 2016 21:31 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
@nukedbit
nukedbit / gitlab.conf
Created September 21, 2016 12:03 — forked from sameersbn/gitlab.conf
Nginx reverse proxy configuration for GitLab
upstream gitlab {
server 172.17.42.1:10080 fail_timeout=0;
}
# let gitlab deal with the redirection
server {
listen 80;
server_name git.example.com;
server_tokens off;
root /dev/null;
* Reducing executable size:
http://developer.xamarin.com/guides/cross-platform/deployment,_testing,_and_metrics/memory_perf_best_practices/#Reducing_Executable_Size
* Use the linker (iOS [1], Android [2]) to remove unnecessary code from your assemblies
[1] https://developer.xamarin.com/guides/ios/advanced_topics/linker
[2] https://developer.xamarin.com/guides/android/advanced_topics/linking
* Reference third-party libraries judiciously
* Applying constraints to generics may reduce app size, since less code would need to be included (haven’t verified this)
@nukedbit
nukedbit / fix-wordpress-permissions.sh
Last active December 6, 2016 18:12 — 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
@nukedbit
nukedbit / web.csproj
Created December 10, 2016 11:11
net core app on vs 2017 rc
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.0</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
</PropertyGroup>
<PropertyGroup>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
</PropertyGroup>
@nukedbit
nukedbit / Linux Static IP
Created March 8, 2017 14:27 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static