Skip to content

Instantly share code, notes, and snippets.

"""
# App Engine import data from Datastore Backup to localhost
You can use this script to import large(ish) App Engine Datastore backups to your localohst dev server.
## Getting backup files
Follow instructions from Greg Bayer's awesome article to fetch the App Engine backups:
http://gbayer.com/big-data/app-engine-datastore-how-to-efficiently-export-your-data/

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$> npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
@mnjstwins
mnjstwins / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
var AngularJSApp = angular.module("AngularJSApp", ["ngResource", "ngSanitize"])
.config(function ($routeProvider, $httpProvider) {
$routeProvider.
when('/', { controller: NavigationCtrl, templateUrl: 'navigation.html' }).
when('/feedback', { controller: FeedbackCtrl, templateUrl: 'feedback.html' }).
otherwise({ redirectTo: '/' });
$httpProvider.defaults.withCredentials = true;
delete $httpProvider.defaults.headers.common["X-Requested-With"];
@mnjstwins
mnjstwins / ascii_movie_image_ver_1.py
Created October 4, 2015 15:23 — forked from MotionDesignStudio/ascii_movie_image_ver_1.py
Python ASCII Video And ASCII Image Creator
#!/usr/bin/env python
import sys
import cv2
import subprocess
from subprocess import call
import aalib
import Image
@mnjstwins
mnjstwins / Calculated InitialExpression
Created October 21, 2015 11:56 — forked from mccrackend/Calculated InitialExpression
Using a calculated value for a property's InitialExpression. Written in Intersystems Cache Object Script.
...class definition
/// Set InitialExpression to any class method returning the calculated value.
/// In this case, I'm returning a string value.
Property BaseDirectoryPath As %String [ InitialExpression = {..GetBaseDirectoryForNamespace()} ];
/// Returns the base directory path to use for whatever cache instance the class is being used in.
ClassMethod GetBaseDirectoryForNamespace() As %String
{
SET vPath = $CASE($Namespace,
@mnjstwins
mnjstwins / gist:13ee1da02885853e358e
Created November 6, 2015 20:34 — forked from pullmonkey/gist:778755
XML example of the dataset from VIN API
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<telescopic-steering-column>Std.</telescopic-steering-column>
<front-split-bench-seat>N/A</front-split-bench-seat>
<powertrain-warranty-distance>36,000 mile</powertrain-warranty-distance>
<leather-seat>Std.</leather-seat>
<load-bearing-exterior-rack>N/A</load-bearing-exterior-rack>
<front-spring-type>Coil</front-spring-type>
<steel-wheels>N/A</steel-wheels>
<maximum-gvwr>No data lbs</maximum-gvwr>
@mnjstwins
mnjstwins / pyrss2gen-example.py
Created November 21, 2015 15:31 — forked from martg0/pyrss2gen-example.py
PyRSS2Gen example
"""
example of the usage of pyrss2gen library.
URL: http://www.dalkescientific.com/Python/PyRSS2Gen.html
"""
import datetime
import PyRSS2Gen
rss = PyRSS2Gen.RSS2(
title = "Andrew's PyRSS2Gen feed",
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2015.3 (Build 211U)" ts="2015-11-06 21:30:14">
<Class name="Utils.DynamicObject">
<Super>%RegisteredObject</Super>
<TimeChanged>63862,77333.461179</TimeChanged>
<TimeCreated>63862,75470.717321</TimeCreated>
<Property name="obj">
<Description>
Свойство, хранящее настоящий динамический объект</Description>
Class Debug.Trace Extends %RegisteredObject
{
ClassMethod On(aGN As %String = "") As %Status [ ProcedureBlock = 0 ]
{
#define InvalidIO $io'=$p
if aGN="" set %TraceLog=$name(^CacheTemp.TraceLog)
else set %TraceLog=aGN
kill @%TraceLog
for i=1:1:$stack-1 {