Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| import javax.crypto.spec.SecretKeySpec | |
| import javax.crypto.Mac | |
| object A { | |
| def main(args: Array[String]): Unit = { | |
| val secret = new SecretKeySpec("the_secret".getBytes, "HmacSHA1") | |
| val mac = Mac.getInstance("HmacSHA1") | |
| mac.init(secret) | |
| val result: Array[Byte] = mac.doFinal("foo".getBytes) | |
| println(result.map(_.toString).mkString(",")) |
| In order for this to work you need ffmpeg. I tried with version 1.2.1. | |
| 1) Play the video you want to download in the browser | |
| 2) Inspect the video element on the page | |
| 3) Copy the video url from the page source (something like http://devstreaming.apple.com/videos/wwdc/2013/.../101/ref.mov) | |
| 4) In this url replace "ref.mov" with "iphone_c.m3u8" (for 960x540 resolution) or "atp.m3u8" if you want more (probably 720p?) | |
| 5) Execute `ffmpeg -y -i http://devstreaming.apple.com/videos/wwdc/2013/.../101/iphone_c.m3u8 output.mp4` | |
| 6) There is your video :) |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| # vim: set ft=pf | |
| # /etc/pf.conf | |
| ext_if="vtnet0" | |
| webports = "{http, https}" | |
| int_tcp_services = "{domain, ntp, smtp, www, https, ftp}" | |
| int_udp_services = "{domain, ntp}" | |
| set skip on lo |
| function dex-method-count() { | |
| cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"' | |
| } | |
| function dex-method-count-by-package() { | |
| dir=$(mktemp -d -t dex) | |
| baksmali $1 -o $dir | |
| for pkg in `find $dir/* -type d`; do | |
| smali $pkg -o $pkg/classes.dex | |
| count=$(dex-method-count $pkg/classes.dex) | |
| name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.') |
| /** | |
| The MIT License (MIT) | |
| Copyright (c) 2013 Jean Helou | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is |
| package com.agilogy.spray.cors | |
| import spray.http.{HttpMethods, HttpMethod, HttpResponse, AllOrigins} | |
| import spray.http.HttpHeaders._ | |
| import spray.http.HttpMethods._ | |
| import spray.routing._ | |
| // see also https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS | |
| trait CORSSupport { | |
| this: HttpService => |
RecyclerView does not have an OnItemClickListener like it's predecessor, ListView. However, detecting item clicks is pretty simple.
Set an OnClickListener in your ViewHolder creation:
private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> {
public static class ViewHolder extends RecyclerView.ViewHolder| --- Actions --- | |
| $Copy <M-C> | |
| $Cut <M-X> <S-Del> | |
| $Delete <Del> <BS> <M-BS> | |
| $LRU | |
| $Paste <M-V> | |
| $Redo <M-S-Z> <A-S-BS> | |
| $SearchWeb <A-S-G> | |
| $SelectAll <M-A> | |
| $Undo <M-Z> |