Skip to content

Instantly share code, notes, and snippets.

// Generated by CoffeeScript 1.7.1
(function() {
var SearchView, searchView,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
SearchView = (function(_super) {
__extends(SearchView, _super);
function SearchView() {
class SearchView extends Backbone.View
el: $ '#submitbtn'
initialize: ->
_.bindAll @, "searchStart", "makeSelectedTextHighLight"
@.collection = new Dichelp.Collections.SelectedWords
@.sources = Dichelp.Collections.WebAPIs
return undefined
Refresh Android mediastore using adb
up vote
3
down vote
favorite
1
I'm using adb to sync music on an android phone. Essentially, I rm the existing music directory and push replacement music files.
I'd like to be able to use adb to force a rescan, so that the google music player (and other apps) works properly with the new songs and playlists.
<receiver
android:name="com.lzy.music.widget.MusicWidgetProvider"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="com.lzy.music.broadcast" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
Intent playpause = new Intent(context, MusicPlayerService.class);
playpause.putExtra(MusicPlayerService.REQUEST_TYPE, MusicPlayerService.PLAY_PAUSE);
playpause.putExtra("from_widget", true);
PendingIntent pendingIntent4 = PendingIntent.getService(context, 0, playpause,
PendingIntent.FLAG_UPDATE_CURRENT);
views.setOnClickPendingIntent(R.id.playpause, pendingIntent4);
Intent prev = new Intent(context, MusicPlayerService.class);
prev.putExtra("from_widget", true);
prev.putExtra(MusicPlayerService.REQUEST_TYPE, MusicPlayerService.REWIND);
@lzsucceed
lzsucceed / TouchInterceptorGridView.java
Created May 12, 2014 12:30
TouchInterceptorGridView.java
package com.lzy.music.parts;
/*
* Copyright (C) 2013 TInoue
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
# coding:utf-8
import heapq
import time
current_milli_time = lambda: int(round(time.time() * 1000))
timeStart = current_milli_time()
class State:
def __init__(self, initialCost, routeArray, visitedNodeArray, costArray):
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;
@lzsucceed
lzsucceed / gist:7052297
Created October 19, 2013 06:30
river crossing problem
(function () {
window.CodeIq = {
};
var c = CodeIq;
c.Stack = function Stack() {
this.__a = new Array();
<?php
if (! defined ( 'BASEPATH' ))
exit ( 'No direct script access allowed' );
require_once APPPATH . '/third_party/src/Mustache/Autoloader.php';
Mustache_Autoloader::register ();
/**
* helper library for Mustache.
* This library must be located in third_party folder.
* You can use like this: