Skip to content

Instantly share code, notes, and snippets.

View sleimanzublidi's full-sized avatar

Sleiman Zublidi sleimanzublidi

  • Miami
  • 14:29 (UTC -04:00)
View GitHub Profile
@sleimanzublidi
sleimanzublidi / PulsingHalo.cs
Created June 5, 2014 21:26
PulsingHalo Animation
using System.Drawing;
using System.Threading.Tasks;
using MonoTouch.CoreAnimation;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Animations
{
/// <summary>
/// Original Objective-C by shu223
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>EXT</string>
<key>NSExportableTypes</key>
<array>
<string>org.temp.ext</string>
</array>
<key>CFBundleTypeRole</key>
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
#OS junk files
[Tt]humbs.db
*.DS_Store
# User-specific files
*.suo
*.user
@sleimanzublidi
sleimanzublidi / EventToAsync
Created January 3, 2014 20:36
Event To Async
public async Task DoSomethingAsync()
{
var tsc = new TaskCompletionSource<object>();
EventHandler<AsyncResult> handler = (o, e) =>
{
if (e.Error == null)
{
tsc.TrySetResult(null);
}
@sleimanzublidi
sleimanzublidi / TreeViewDataSource.cs
Last active June 1, 2016 22:05
TreeView - NSOutlineViewDataSource
public class TreeViewDataSource : NSOutlineViewDataSource
{
private readonly List<TreeItem> source = new List<TreeItem>();
public TreeViewDataSource()
{}
public void Add(TreeItem item)
{
source.Add(item);
@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
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 / 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);
@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))
{
}