This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# | |
# # About | |
# | |
# Since APFS supports de-duplication on block-level, it can be useful to | |
# manually de-duplicate your files if you've migrated/upgrade to APFS not | |
# using a fresh install. | |
# | |
# I've written this simple script with the aim to: | |
# - Be simple, easy to read and understand (for users to check) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CLLocation: Encodable { | |
public enum CodingKeys: String, CodingKey { | |
case latitude | |
case longitude | |
case altitude | |
case horizontalAccuracy | |
case verticalAccuracy | |
case speed | |
case course | |
case timestamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################### Point Distribution Model ##################### | |
## ref to OpenFace PDM model https://github.com/TadasBaltrusaitis/OpenFace/tree/79d7116dae7f6b5335016dcb0e9ea64e1f931287/model_training/pdm_generation | |
def tf_Euler2Rot(euler): | |
batch_size = euler.get_shape().as_list()[0] | |
rx, ry, rz = tf.split(euler, 3, axis=1) | |
Rx_0 = tf.cast(tf.tile(tf.expand_dims([1.0, 0.0, 0.0],0), [batch_size,1]), tf.float64) | |
Rx_1 = tf.concat([tf.zeros_like(rx, tf.float64), tf.cos(rx), -tf.sin(rx)], axis=1) | |
Rx_2 = tf.concat([tf.zeros_like(rx, tf.float64), tf.sin(rx), tf.cos(rx)], axis=1) | |
Rx = tf.concat([tf.expand_dims(Rx_0,1), tf.expand_dims(Rx_1,1), tf.expand_dims(Rx_2,1)], axis=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#if defined(__POWERPC__) | |
#include <ppc_intrinsics.h> | |
#else | |
#ifdef _MSC_VER | |
#include <intrin.h> /* for rdtscp and clflush */ | |
#pragma optimize("gt",on) | |
#else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script creates a self-signed certificate, exports it, and re-imports it into the Trusted Root Certification Authorities store. | |
.DESCRIPTION | |
This script creates a self-signed code signing certificate, valid for one year from the date/time created, that can be used for testing purposes to sign scripts. After the certificate is created, the issuer is untrusted. So, the script then exports the certificate into a .cer file and re-imports it into the Trusted Root Certification Authorities store for the current user (i.e. Cert:\CurrentUser\Root). | |
.PARAMETER DnsName | |
Specify one, or more, DNS names to put into the subject alternative name (SAN) extension of the certificate. The first DNS name is also saved as the subject name, issuer name (i.e. Issued By), and common name (i.e. Issued To). Default is the local computer name (i.e. $Env:ComputerName). This parameter has aliases of SubjectAlternativeName and SAN. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo '' | |
if [ "$1" = "" ]; then | |
echo 'csp sha1 and sha256 generatoor' | |
echo 'csp "code"' | |
echo 'csp /file-name' | |
else | |
if [ -f "$1" ]; then | |
CONTENT=$(cat $1) |