Skip to content

Instantly share code, notes, and snippets.

View richjava's full-sized avatar

Richard Lovell richjava

View GitHub Profile
richjava / gist:ea0d447496ae5ec2c5c8319bbed1680c
Last active September 27, 2020 22:03
Create Netlify site from repo
const netlifySitesUrl = ``;
let netlifyRes = await
netlifySitesUrl + `?access_token=${netlifyAccessToken}`,
repo: {
provider: "github",
repo: `${}/${}`,
private: false,
branch: "master",
richjava / cordova-keystore
Created September 9, 2017 08:02 — forked from rocco/cordova-keystore
cordova/phonegap: create keystore (to sign apk)
# create keystore
keytool -genkey -v -keystore [somename].keystore -alias [somename] -keyalg RSA -keysize 2048 -validity 10000
# follow instructions
# to keep things simple, use [somename] for .keystore file name and alias too
# same for password: just press enter on this prompt:
# ---------------------------------------------------
# Enter key password for <[somename]>
# (RETURN if same as keystore password):
<!DOCTYPE html>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<div onclick="playDogSound()">Play dog sound</div>
richjava / footer.php
Last active March 7, 2016 07:30
Wordpress Development task 2: Basic one-page theme with separate pages
richjava / footer.php
Last active March 7, 2016 07:32
Wordpress Theme Development task 1 - Basic custom theme
richjava / wordpress-xampp-netbeans-getting-started
Created April 14, 2015 03:06
Wordpress/XAMPP/Netbeans getting started
Initial setup
1. Download Wordpress from:
2. Store the file in locally, unzip it, name the unzipped file to the name of your project, then put it in the xampp htdocs folder.
3. Create the project from existing sources in Netbeans.
4. Set up a database in PHPMyAdmin for Wordpress to use.
5. Run the project and follow the steps on the setup page to configure the project.
6. Log in.
Install theme
richjava / drupal-xampp-getting-started
Last active August 29, 2015 14:13
Drupal, XAMPP Getting Started
Download Drupal at
Unzip the compressed drupal file.
Rename the drupal-[version-number-goes-here] to drupal (so you can access it easier as: http://localhost/drupal).
Move the drupal folder to your XAMPP htdocs folder.
Start XAMPP and go to http://localhost/phpmyadmin/
Create a new database in phpMyAdmin for your drupal sites.
Go to http://localhost/drupal and go through the installation process.
As this is just used for local development, for email address just use anything, even (you can change it through Configuration > Site Information at a later time).
After the last step click the link "Visit your new site".
richjava / android-screen-density-pixel-ratio
Created December 16, 2014 04:03
Android screen density pixel ratio
The ratio in pixels between screen densities is:
ldpi = 1:0.75
mdpi = 1:1
hdpi = 1:1.5
xhdpi = 1:2
xxhdpi = 1:3
xxxhdpi = 1:4
For an image of 100X100:
richjava / gradle-assemberelease-in-android-studio
Last active December 2, 2020 01:43
Gradle assembleRelease in Android Studio
For setup of Gradle:
1. Set gradle home in env variables, i.e. GRADLE_HOME C:\gradle-[version-number-goes-here]
2. Put Gradle bin in PATH env variable (append it to the end with';' before it): i.e. ;C:\gradle-1.12\bin
3. Add Android SDK to System Variables.
For release:
richjava / intro-to-js-custom-objects
Last active August 29, 2015 14:10
Intro to javascript custom objects
//modified from
//class (can also be defined as anonymous function in the form of var Person = function () {...};)
function Person(firstName) {
this.firstName = firstName;
// method (using anonymous function)
this.skyte = function() {
return "I'll be famous some day. Remember my name: " + firstName + "!";