A ghetto webhook for automatically deploying after a Docker Hub build.
sudo apt-get install php-cli
(defn float-vec->byte-array | |
[v] | |
(.array (reduce #(.putFloat %1 %2) | |
(java.nio.ByteBuffer/allocate (* (count v) (/ Float/SIZE 8))) | |
v))) | |
# Code has moved to: https://github.com/chetbox/SayYouTubeComments |
# Emulate a user in a terminal for the purposes of a video recording | |
# Waits 1 second for every blank line | |
tell application "Terminal" | |
activate | |
end tell | |
delay 1 | |
tell application "System Events" |
/* | |
This module can be required normally: | |
var optionally_global = require('./optionally_global'); | |
console.log(optionally_global.bar()); | |
Or its exports can be made global: | |
require('./optionally_global').global(); | |
console.log(bar()); |
apk=app.apk count=0 ; for dex in $(unzip -Z1 $apk classes*.dex); do count=$(($count + $(unzip -p $apk $dex | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'))) ; done ; echo $count |
/* Get a value from a nested object using just a string for readability | |
* | |
* Example: | |
* var o = {first: {second: {third: {a: 1, b: 2}}}}; | |
* o.get_in('first.second.third.b'); // => 2 | |
*/ | |
Object.prototype.get_in = function(selector) { | |
return selector.split('.').reduce( | |
function(obj, key) { | |
return obj[key]; |
const _ = require('lodash'); | |
function forEachPage(ref, pageSize, callback, startAt) { | |
var query = ref.orderByKey(); | |
if (startAt) query = query.startAt(startAt); | |
return query.limitToFirst(pageSize + 1) // Ask for one extra | |
.once('value') | |
.then((snapshot) => { | |
if (snapshot.numChildren() <= pageSize) { | |
// There was no extra value returned, this is the last page |
<div class="explorometer"> | |
<h2 style="text-align: center; color: #000000; font-weight: bold;">Beeline Explorometer™</h2> | |
<h2 style="text-align: center; color: #ffffff; font-weight: bold;"><span class="journeys">34,994</span> rides</h2> | |
<h2 style="text-align: center; color: #ffffff; font-weight: bold;"><span class="distance">313,362</span> km</h2> | |
</div> | |
<script src="https://www.gstatic.com/firebasejs/4.5.0/firebase.js"></script> | |
<script> | |
firebase.initializeApp({ | |
databaseURL: "https://beeline-e46ed.firebaseio.com" | |
}); |