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
const ethers = require('ethers') | |
const poolAbi = [ | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{"indexed": true, "internalType": "address", "name": "sender", "type": "address"}, | |
{"indexed": true, "internalType": "address", "name": "recipient", "type": "address"}, | |
{"indexed": false, "internalType": "int256", "name": "amount0", "type": "int256"}, | |
{"indexed": false, "internalType": "int256", "name": "amount1", "type": "int256"}, |
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
const functions = require("firebase-functions"); | |
const admin = require("firebase-admin"); | |
const ffmpeg_static = require("ffmpeg-static"); | |
const { Storage } = require("@google-cloud/storage"); | |
const path = require("path"); | |
const storage = new Storage(); | |
const os = require("os"); | |
const fs = require("fs-extra"); | |
const { ALLOWED_EXTENAMES } = require("./consts"); | |
const { spawn } = require("child_process"); |
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
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
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 sh | |
VBOX_LATEST_VERSION=$(curl http://download.virtualbox.org/virtualbox/LATEST.TXT) | |
wget -c http://download.virtualbox.org/virtualbox/${VBOX_LATEST_VERSION}/VBoxGuestAdditions_${VBOX_LATEST_VERSION}.iso -O /tmp/VBoxGuestAdditions_${VBOX_LATEST_VERSION}.iso | |
sudo mkdir -p /media/guestadditions ; sudo mount -o loop /tmp/VBoxGuestAdditions_${VBOX_LATEST_VERSION}.iso /media/guestadditions | |
sudo /media/guestadditions/VBoxLinuxAdditions.run | |
sudo umount /media/guestadditions && sudo rm -rf /tmp/VBoxGuestAdditions_$VBOX_VERSION.iso /media/guestadditions | |
echo 'You may safely ignore the message that reads: "Could not find the X.Org or XFree86 Window System."' |
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
sudo aptitude install ffmpeg | |
sudo aptitude install imagemagick | |
# fps=1 > every seconds | |
ffmpeg -i video.mp4 -f image2 -vf fps=fps=1 out%d.png | |
# horizontal sprite, resized at 30% | |
convert -resize 30% +append out*.png sprite-1-sec.png | |
# references: |
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
<?php | |
/** | |
* Outputs a rasio button form field | |
*/ | |
function woocommerce_form_field_radio( $key, $args, $value = '' ) { | |
global $woocommerce; | |
$defaults = array( | |
'type' => 'radio', | |
'label' => '', |
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
@ViewChild(AgmMap) myMap: AgmMap; | |
...... | |
// Specific type 'de-assertion' for only this call: | |
.then(() => (this.myMap as any)._mapsWrapper.setCenter({lat: this.lat, lng: this.lng})); |