Skip to content

Instantly share code, notes, and snippets.

View andreinitescu's full-sized avatar

Andrei Nitescu andreinitescu

View GitHub Profile
@kennym
kennym / blogspot_to_jekyll.rb
Created July 30, 2011 18:14
Migrate your blogger blog posts to jekyll.
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format:
@cjoudrey
cjoudrey / twitter.js
Created November 5, 2011 16:37
Lazy-rendering in PhantomJS
// This example shows how to render pages that perform AJAX calls
// upon page load.
//
// Instead of waiting a fixed amount of time before doing the render,
// we are keeping track of every resource that is loaded.
//
// Once all resources are loaded, we wait a small amount of time
// (resourceWait) in case these resources load other resources.
//
// The page is rendered after a maximum amount of time (maxRenderTime)
@detroitpro
detroitpro / Developer-Questions.textile
Last active March 16, 2017 10:42
.NET Developer-Questions

You

  • Your twitter name:
  • Your blog address:
  • Your stackoverflow name:
  • Your github name:

Think of

The following is a list of nouns (person,place,thing). Please write down your first thoughts on each one. There is no right answer and it is assume you will not know all of them.

@WinstonFassett
WinstonFassett / KOBindings.js
Created June 12, 2012 20:58
Common Knockout Bindings
// from https://github.com/SteveSanderson/knockout/wiki/Bindings---class
// addresses https://github.com/SteveSanderson/knockout/issues/233
// be careful of using the attr binding -- it has issues with iOS and quotes
// instead, use this to bind to the class attribute
ko.bindingHandlers['class'] = {
'update': function (element, valueAccessor) {
if (element['__ko__previousClassValue__']) {
$(element).removeClass(element['__ko__previousClassValue__']);
}
var value = ko.utils.unwrapObservable(valueAccessor());
@KennyGoers
KennyGoers / RecursiveDescription.cs
Created July 21, 2012 15:14
A VERY useful extension method for MonoTouch to dump a view stack to a log or console, you can supply the UIApplication.SharedApplication.KeyWindow even for a full view dump, this is an undocumented iOS selector, but generally used for debugging anyway.
using System;
using MonoTouch.Foundation;
using MonoTouch.ObjCRuntime;
using MonoTouch.UIKit;
namespace NS {
public static class UIViewExtensions {
// returns the view and all child views with status
public static string RecursiveDescription(this UIView view)
@blitzvb
blitzvb / gist:7696435
Created November 28, 2013 18:34
Swizzling Method in #xamarin
[DllImport ("/usr/lib/libobjc.dylib")]
extern static IntPtr class_getInstanceMethod (IntPtr classHandle, IntPtr Selector);
[DllImport ("/usr/lib/libobjc.dylib")]
extern static Func<IntPtr,IntPtr,IntPtr> method_getImplementation (IntPtr method);
[DllImport ("/usr/lib/libobjc.dylib")]
extern static IntPtr imp_implementationWithBlock (ref BlockLiteral block);
[DllImport ("/usr/lib/libobjc.dylib")]
extern static void method_setImplementation (IntPtr method, IntPtr imp);
static Func<IntPtr,IntPtr,IntPtr> original_impl;
@jamesmontemagno
jamesmontemagno / MvxActionBarActivity.cs
Created December 27, 2013 04:57
Compatibility classes if you use Action Bar Compat (v7) with MvvmCross
using Android.Content;
using Cirrious.MvvmCross.Binding.BindingContext;
using Cirrious.MvvmCross.Binding.Droid.BindingContext;
using Cirrious.MvvmCross.ViewModels;
using MeetupManager.Droid.Helpers;
using Cirrious.MvvmCross.Droid.Views;
namespace MyProject
{
public abstract class MvxActionBarActivity
@eberlitz
eberlitz / APIKeyAuthentication.cs
Created March 21, 2014 19:50
Custom OWIN Middleware Sample
#region API KEY Authentication
public static class APIKeyDefaults
{
public const string AuthenticationType = "Apikey";
}
public class APIKeyAuthenticationOptions : AuthenticationOptions
{
/// <summary>
/// Creates an instance of API Key authentication options with default values.
@conceptdev
conceptdev / EmbeddedImageResourceExtension.cs
Created June 9, 2014 23:06
Xamarin.Forms custom markup extension because there is no built-in TypeConverter for Images embedded as resources
using System;
using Xamarin.Forms.Xaml;
using Xamarin.Forms;
namespace WorkingWithImages
{
// You exclude the 'Extension' suffix when using in Xaml markup
[ContentProperty ("Source")]
public class ImageResourceExtension : IMarkupExtension
{
@staltz
staltz / introrx.md
Last active July 29, 2024 05:55
The introduction to Reactive Programming you've been missing