Skip to content

Instantly share code, notes, and snippets.

View sleimanzublidi's full-sized avatar

Sleiman Zublidi sleimanzublidi

  • Miami
  • 19:39 (UTC -04:00)
View GitHub Profile
@sleimanzublidi
sleimanzublidi / blurimage.cs
Created March 14, 2018 20:29
Blur UIImage
public static UIImage WithBlurEffect(this UIImage inputImage, float radius = 15f)
{
if (inputImage == null)
{
return null;
}
var ciImage = new CIImage(inputImage);
var gaussianBlur = new CIGaussianBlur
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : 0.3333333432674408,
"Blue Component" : 1,
"Red Component" : 0.3333333432674408
},
# PATH
export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
#export PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
#export PATH="/Library/Frameworks/Mono.framework/Versions/Current/bin/:${PATH}"
# ALIASES
alias nuget="mono /usr/local/bin/nuget.exe"
alias cls="clear"
alias xo="find . \( -name "*.xcworkspace" \) -type d -maxdepth 1 -prune -print0 | xargs open"
@sleimanzublidi
sleimanzublidi / Xamarin.iOS.cs
Last active November 2, 2017 21:20
Xamarin.iOS
--framework:/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/RevealServer.framework
if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
{
}
@sleimanzublidi
sleimanzublidi / Pulse.cs
Created November 2, 2017 19:01
Xamarin.iOS Pulse Animation
public static void Pulse(this UIView view, float scale, double duration = 1.0, bool repeat = true)
{
var animation = CABasicAnimation.FromKeyPath("transform.scale");
animation.Duration = duration;
animation.To = NSNumber.FromFloat(scale);
animation.TimingFunction = CAMediaTimingFunction.FromName(CAMediaTimingFunction.EaseInEaseOut);
animation.AutoReverses = true;
animation.RepeatCount = repeat ? float.MaxValue : 0;
@sleimanzublidi
sleimanzublidi / AnimateUICollectionView.cs
Last active October 5, 2017 18:34
Animate UICollectionView
UIView.TransitionNotify(
this.CollectionView,
duration: 0.5,
options: UIViewAnimationOptions.TransitionCrossDissolve,
animation: delegate { },
completion: delegate { });
var frame = this.CollectionView.Frame;
@sleimanzublidi
sleimanzublidi / gist:db162c8125d7d24f3f6fc5d28e417e05
Last active November 2, 2017 18:59
Implementing the Twitter Scroll
http://www.thinkandbuild.it/implementing-the-twitter-ios-app-ui/
var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light);
var blurView = new UIVisualEffectView(blur)
{
Frame = this.Image.Bounds
};
this.bluredImage.Image = this.Image.Image;
this.bluredImage.AddSubview(blurView);
if (!string.IsNullOrWhiteSpace(webContentViewModel.Url))
{
var safariViewController = new SFSafariViewController(new NSUrl(webContentViewModel.Url))
{
PreferredBarTintColor = Theme.Colors.NavigationBarBackgroundColor,
PreferredControlTintColor = Theme.Colors.AccentColor
};
return this.viewPresenter.Show(safariViewController);
}
@sleimanzublidi
sleimanzublidi / Cloudbox
Last active July 23, 2016 15:26
Cloudbox SSH
t's quite easy, no disassembling required.
1. Enable SFTP in the web interface
2. Open a SFTP connection to the box using your admin account
3. Change directory to the Admin: cd Admin
4. Create a link for default.runlevel file: symlink /etc/initng/runlevel/default.runlevel default.runlevel
5. Create a link for shadow file: symlink /etc/shadow shadow
6. Create a link for unicorn.sharing.ssh.conf file: symlink /etc/unicorn/unicorn_conf/unicorn.sharing.ssh.conf unicorn.sharing.ssh.conf
7. You can close SFTP connection now
8. Open the web file manager in your browser and navigate to the Admin folder
using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;