First, Lets find out what version of PHP we're running (To find out if it's the default version).
To do that, Within the terminal, Fire this command:
which php
public static void exportAllDatabases(final Context context) { | |
Log.d(LOG_TAG, "exportAllDatabases: "); | |
File sd = Environment.getExternalStorageDirectory(); | |
if (sd.canWrite()) { | |
final File[] databases = new File(context.getFilesDir().getParentFile().getPath() + "/databases").listFiles(); | |
for (File databaseFile: databases) { | |
final String backupFilename = databaseFile.getName() + "-" + Build.SERIAL + | |
"-" + System.currentTimeMillis() + ".db"; | |
File backupFile = new File(sd, backupFilename); | |
FileChannel inputChannel = null; |
<?php | |
/* | |
* Script that shows how to insert a basepath on HTML tags | |
* It looks for link, script and img tags that do not contain the | |
* determined basepath or a external URL | |
*/ | |
// BasePath to insert in string when necessarry | |
$basePath = "/project/site/"; | |
$escapedBasePath = str_replace("/", "\/", $basePath); |
<?php | |
// copied from python code at https://stackoverflow.com/a/23221582/3103058 | |
function base32_decode($key) { | |
// https://www.php.net/manual/en/function.base-convert.php#122221 | |
$key = strtoupper($key); | |
list($t, $b, $r) = array("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", "", ""); | |
foreach(str_split($key) as $c) | |
$b = $b . sprintf("%05b", strpos($t, $c)); | |
foreach(str_split($b, 8) as $c) | |
$r = $r . chr(bindec($c)); |
<? | |
/* This file is released under the GPL, any version you like | |
* | |
* PHP PSD reader class, v1.3 | |
* | |
* By Tim de Koning | |
* | |
* Kingsquare Information Services, 22 jan 2007 | |
* | |
* example use: |
This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.
You want a script that does a local compile to e.g. an out/
directory. Let's call this compile.sh
for our purposes, but for your project it might be npm build
or gulp make-docs
or anything similar.
The out/
directory should contain everything you want deployed to gh-pages
. That almost always includes an index.html
.
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
@dot_cycle = ['⣾','⣽','⣻','⢿','⡿','⣟','⣯','⣷'] | |
#braille random: 0x2800 - 0x28ff | |
@z_arrow = ['←','↖','↑','↗','→','↘','↓','↙'] | |
@z_b = ['b','ᓂ','q','ᓄ'] | |
@z_d = ['d','ᓇ','p','ᓀ'] |
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { | |
// no easing, no acceleration | |
linear: function (t) { return t }, | |
// accelerating from zero velocity | |
easeInQuad: function (t) { return t*t }, | |
// decelerating to zero velocity |
/** | |
* http://applemusic.tumblr.com/ | |
* https://jsfiddle.net/xq56dmrh/ | |
*/ | |
/** Ultra Light */ | |
@font-face { | |
font-family: "San Francisco"; | |
font-weight: 100; | |
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.woff"); |