Skip to content

Instantly share code, notes, and snippets.

@ryan-roemer
ryan-roemer / app.yaml
Created January 6, 2012 13:39 — forked from darktable/app.yaml
App.yaml designed for serving an authenticated, static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May n
# App configuration for static site with auth.
#
# Originally from: https://gist.github.com/873098
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
@thefuxia
thefuxia / t5-page-feed.php
Created May 22, 2012 00:47
Newsfeed for post type 'page'
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Page Feed
* Description: Adds a feed for pages at <code>/feed/?post_type=page</code>.
* Version: 2012.05.22
* Author: Thomas Scholz
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*/
@nicdoye
nicdoye / mysqlbackup.sh
Created February 2, 2013 13:07
Backup your OpenShift MySQL database. My DB is only small so I didn't bother to compress it through a pipe. sftp it back from your local machine afterwards This is basically a quick hack from running "type mysql" on the OpenShift gear - hint: it's a bash function/alias
mkdir ~/app-root/data/tmp
mysqldump -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" --all-databases > ~/app-root/data/tmp//all.sql
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
@oliverdoetsch
oliverdoetsch / AND_OR_NOT
Last active January 22, 2023 17:03
Blogger: Globally conditional data tags for all page types
#AND
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--search_page AND index_page-->
</b:if>
</b:if>
#OR
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
#!/bin/bash
# update apt-get
export DEBIAN_FRONTEND="noninteractive"
sudo apt-get update
# remove previously installed Docker
sudo apt-get purge lxc-docker*
sudo apt-get purge docker.io*
import speech_recognition
import pyttsx
speech_engine = pyttsx.init('sapi5') # see http://pyttsx.readthedocs.org/en/latest/engine.html#pyttsx.init
speech_engine.setProperty('rate', 150)
def speak(text):
speech_engine.say(text)
speech_engine.runAndWait()
@remarkablemark
remarkablemark / README.md
Last active November 12, 2023 07:52
Classes - ES5 vs ES6

JavaScript Classes - ES5 vs ES6

An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.

Reference

@nikahmadz
nikahmadz / ThemeBasics.md
Last active April 27, 2024 09:00
Tutorial Notes On Building A Blogger Theme

Theme Basics

Theme Basics is a series of tutorial notes on building a Blogger theme.

Discover tips and learn how to start building your own Blogger theme:

  • Minimum code requirements.
  • Basic templates.
  • Tags & Data definitions.
  • Resources and examples.