Skip to content

Instantly share code, notes, and snippets.

View stephanie-gredell's full-sized avatar

Stephanie Gredell stephanie-gredell

View GitHub Profile
@stephanie-gredell
stephanie-gredell / gist:9c7f7458387f9310b7bd
Last active August 29, 2015 14:17
Create a ManyToMany relationship in EBean
public class EntityList extends Model {
@Id
private Integer id;
@Constraints.Required
public String title;
@Constraints.Required
public String type;
// Require
var watchr = require('watchr');
var exec = require('child_process').exec;
watchr.watch({
paths: ['js', 'css', 'templates'],
listeners: {
error: function (err) {
console.log('an error occured:', err);
}, change: function () {
# create app
app = flask.Flask(__name__) app.config['DEBUG'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'databaseurlgoeshere'
db = flask.ext.sqlalchemy.SQLAlchemy(app)
# models
class User(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
@stephanie-gredell
stephanie-gredell / gist:f8fb80e06eddd44b1911
Created March 20, 2015 08:45
Vimeo API and Backbone View
var Backbone = require('backbone');
var template = require('templates/video');
var $ = require('jquery');
module.exports = Backbone.View.extend({
videoUrl: '//player.vimeo.com/video/119777338',
events: {'click button': 'playButtonPressed'},
render: function () {
$(this.el).html(template({url: this.videoUrl}));
$('body').append(this.el);
this.$player = $('iframe');
@stephanie-gredell
stephanie-gredell / gist:0bdbcc878002956a417f
Created March 20, 2015 08:43
Redirect HTTP to HTTPS using nginx
server {
listen 80;
servername server.com;
return 301 https://$servername$requesturi;
}
server {
listen 443 ssl;
servername server.com;
sslcertificate /path/to/ssl/cert.pem;
server {
listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
root /var/www; index index.html index.htm; # Make site accessible from http://localhost/ servername domain.com www.domain.com;
location /api/ {
proxypass http://localhost:3000;
proxysetheader Host $host;
proxy_buffering off;
@stephanie-gredell
stephanie-gredell / golang on fedora
Last active August 29, 2015 14:07
Installing GoLang on Fedora
sudo yum install mercurial
hg clone -u release https://go.googlecode.com/hg/golang
#there's a fair bit of waiting at this step apparently.
cd golang/src
./all.bash
@stephanie-gredell
stephanie-gredell / install google chrome on fedora 18
Created October 11, 2014 06:12
Installing Google Chrome on Fedora 18
#download rpm file from here: http://www.google.com/chrome
#install require packages
yum install lsb wget
#change directory to where you downloaded your RPM file and then run this:
sudo rpm -ivh google-chrome-stable_current_x86_64.rpm
@stephanie-gredell
stephanie-gredell / gist:55c2e3e2ef56c73017e5
Created July 20, 2014 06:13
Remove crap from Wordpress WP_Head
<?php
// clean up wp_head
wp_deregister_style( 'open-sans' );
remove_action ('wp_head', 'rsd_link');
remove_action( 'wp_head', 'wlwmanifest_link');
remove_action( 'wp_head', 'wp_shortlink_wp_head');
remove_action('wp_head', 'wp_generator');
function keep_open_sans_in_admin() {
wp_register_style( 'open-sans', false );