Skip to content

Instantly share code, notes, and snippets.

View naXa777's full-sized avatar
:octocat:

Pavel naXa777

:octocat:
View GitHub Profile
@kramer65
kramer65 / JodaDateTimeSerializer.java
Created September 26, 2013 11:06
Serializer for Joda DateTime with ActiveAndroid ORM.
package com.activeandroid.serializer;
import org.joda.time.DateTime;
public final class JodaDateTimeSerializer extends TypeSerializer {
public Class<?> getDeserializedType() {
return DateTime.class;
}
public Class<?> getSerializedType() {
@chrislkeller
chrislkeller / import_json_appsscript.js
Last active December 27, 2024 01:01
Adds what amounts to an =ImportJSON() function to a Google spreadsheet... To use go to Tools --> Script Editor and add the script and save.
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@skyebook
skyebook / backup_postgres.sh
Last active April 16, 2016 13:20
Backup OpenShift PostgreSQL Database
#!/bin/bash
# Backs up the OpenShift PostgreSQL database for this application
# by Skye Book <[email protected]>
NOW="$(date +"%Y-%m-%d")"
FILENAME="$OPENSHIFT_DATA_DIR/$OPENSHIFT_APP_NAME.$NOW.backup.sql.gz"
pg_dump $OPENSHIFT_APP_NAME | gzip > $FILENAME