var buff = new Buffer(100); | |
fs.open(file, 'r', function(err, fd) { | |
fs.read(fd, buff, 0, 100, 0, function(err, bytesRead, buffer) { | |
var start = buffer.indexOf(new Buffer('mvhd')) + 17; | |
var timeScale = buffer.readUInt32BE(start, 4); | |
var duration = buffer.readUInt32BE(start + 4, 4); | |
var movieLength = Math.floor(duration/timeScale); | |
console.log('time scale: ' + timeScale); | |
console.log('duration: ' + duration); |
### SSL Part 1: Creating Java SSL KeyStore (JKS) | |
This is part one of a three-part series on how to configure a single SSL certificate for use on both Tomcat and Apache. I'll take you through creating a new Java KeyStore (JKS), submitting a Certificate Signing Request (CSR), and finally, importing the singed certificate into your KeyStore. | |
#### 1\. First, create a directory for your SSL files | |
# sudo mkdir /etc/my_ssl | |
#### 2\. Now change into that directory |
1. Download the phpseven branch of the imagick repository
git clone https://github.com/mkoppanen/imagick.git imagick
2. phpize for target PHP version
cd imagick && /path/to/php7/bin/phpize && ./configure && make && make install
3. Enable the extension for your PHP version
about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar.
Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and
rendering normally. Some settings may also make firefox unstable.
I am not liable for any damages/loss of data.
Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions
(HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".
/// | |
/// Simple pooling for Unity. | |
/// Author: Martin "quill18" Glaude (quill18@quill18.com) | |
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267 | |
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/) | |
/// UPDATES: | |
/// 2015-04-16: Changed Pool to use a Stack generic. | |
/// | |
/// Usage: | |
/// |
using UnityEngine; | |
using System.Collections; | |
public class SmoothFollow2D : MonoBehaviour { | |
//offset from the viewport center to fix damping | |
public float m_DampTime = 10f; | |
public Transform m_Target; | |
public float m_XOffset = 0; | |
public float m_YOffset = 0; |
ImageView imageView = (ImageView) findViewById(R.id.card_thumbnail_image); | |
Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.rose); | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){ | |
//Default | |
imageView.setBackgroundResource(R.drawable.rose); | |
} else { | |
//RoundCorners | |
RoundCornersDrawable round = new RoundCornersDrawable(mBitmap, | |
getResources().getDimension(R.dimen.cardview_default_radius), 0); //or your custom radius |
#include <dirent.h> | |
#include <iterator> | |
#include <cstdlib> | |
#include <cstring> | |
#include <sstream> | |
#include <iostream> | |
#include <stdlib.h> | |
#include <string> | |
#include <sys/stat.h> | |
#include <syslog.h> |