Skip to content

Instantly share code, notes, and snippets.

using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.CompliancePolicy;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
namespace Policies
{
class Program
function getCommentCount(url, itemId) {
var soapEnv =
"<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" +
"<soap:Body>" +
"<CountCommentsOnUrl xmlns='http://microsoft.com/webservices/SharePointPortalServer/SocialDataService'>" +
"<url>" + url + "</url>" +
"</CountCommentsOnUrl>" +
"</soap:Body>" +
"</soap:Envelope>";
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
wp_nav_menu(
array(
//'theme_location' => 'header-menu',
//'menu' => 'Top nav',
'depth' => 2,
'container' => 'div',
'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
'walker' => new wp_bootstrap_navwalker()
<?php
function theme_wp_nav_menu_sub_menu_objects( $sorted_menu_items, $args ) {
if ( isset( $args->sub_menu ) ) {
$root_id = 0;
//var_dump($sorted_menu_items);
// find the current menu item
foreach ( $sorted_menu_items as $menu_item ) {
if ( $menu_item->current ) {
08-29 18:07:47.076: E/AndroidRuntime(3184): FATAL EXCEPTION: main
08-29 18:07:47.076: E/AndroidRuntime(3184): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1888, result=-1, data=Intent { act=inline-data (has extras) }} to activity {com.example.photodiary/com.example.photodiary.NewEntryActivity}: java.lang.NullPointerException
08-29 18:07:47.076: E/AndroidRuntime(3184): at android.app.ActivityThread.deliverResults(ActivityThread.java:3319)
08-29 18:07:47.076: E/AndroidRuntime(3184): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3362)
08-29 18:07:47.076: E/AndroidRuntime(3184): at android.app.ActivityThread.access$1100(ActivityThread.java:141)
08-29 18:07:47.076: E/AndroidRuntime(3184): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282)
08-29 18:07:47.076: E/AndroidRuntime(3184): at android.os.Handler.dispatchMessage(Handler.java:99)
08-29 18:07:47.076: E/AndroidRuntime(3184): at android.os.Looper.loop(Looper.java:137)
08-29 1
package com.example.photodiary;
import android.os.Bundle;
import android.provider.MediaStore;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
package com.example.photodiary;
import android.content.Context;
import android.view.*;
import android.app.*;
import android.widget.*;
import java.util.*;
public class DiaryAdapter extends BaseAdapter {
package com.example.photodiary;
import android.content.Context;
import android.widget.ArrayAdapter;
import android.view.*;
import android.app.*;
import android.widget.*;
import java.util.*;
@gabbsmo
gabbsmo / HandbrakeCLI-Hardsub-SRT.ps1
Last active December 16, 2015 05:58
Burn in srt subtitles into a mkv-file
#COPYRIGHT: Gabriel Smoljar (2012)
#WEBSITE: http://twitter.com/gabbsmo
#DESCRIPTION: This PowerShell script process all mkv- and srt-files in a directory by
# first converting the srt subtitles to ssa and then muxing them with their
# corresponding mkv container in a tmp directory. The muxed mkv-files are then
# reencoded with the subtitles burned in.
#
#NOTES: HandbrakeCLI, FFMPEG and MKVMerge must be added to PATH for this script to work.
# Apply all parameters according to the HandbrakeCLI docs: https://trac.handbrake.fr/wiki/CLIGuide
#DEPENDENCIES: HanbrakeCLI, http://handbrake.fr; FFMPEG, http://www.ffmpeg.org;