Skip to content

Instantly share code, notes, and snippets.

View SwipeNames.vue
<template>
<div id="app" class="tinder-app">
<MatchModal
v-if="showMatchModal"
:gender="latestMatchGender"
:name="latestMatchName"
v-on:click.native="showMatchModal = false"
/>
<ConnectAccountsModal
v-if="showConnectModal"
@jsutterfield
jsutterfield / settings.py
Created Jun 12, 2020 — forked from ipmb/settings.py
Django logging example
View settings.py
import logging.config
import os
from django.utils.log import DEFAULT_LOGGING
# Disable Django's logging setup
LOGGING_CONFIG = None
LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper()
logging.config.dictConfig({
View generateText.py
#! /usr/bin/python
import csv
class GetPostCreator(object):
THEME_IDS = [1, 2, 3]
def __init__(self, id, row):
self.id = self.wrap_in_quotes(str(id))
View lightbox.spec.js
describe('Lightbox', function () {
'use strict';
var windowMock = {},
historyApi = modules['wikia.history'](windowMock),
lightbox = window.Lightbox;
it('lightbox is defined', function () {
expect(lightbox).toBeDefined();
});
View results
Videos By Provider
=================
youtube: 748344
ign: 100159
screenplay: 60724
anyclip: 60414
ooyala: 18273
dailymotion: 9021
vimeo: 4233
metacafe: 3069
View reportTotalVideosOnWikia.php
<?php
class reportTotalVideosOnWikia {
const LOG_FILE = '/tmp/reportTotalVideosOnWikiaAll.csv';
public static function run ( $db, $test = false, $verbose = false, $params ) {
$dbname = $params['dbname'];
View wikia_video_stats.py
#!/bin/python
import operator
def main():
fp = open("reportTotalVideosOnWikiaAll.csv", "r")
vids_by_provider = {}
vids_by_wiki = {}
# Lines are in the csv form provider,count,wiki
for line in fp.readlines():
View superbeta_models.py
from django.db import models
from django.contrib.localflavor.us.models import USStateField, PhoneNumberField
def save_area(instance, file_name):
return "photos/%s/%s/%s" % (instance.area.state, instance.area.name, file_name)
def save_problem(instance, file_name):
return "photos/%s/%s/%s/%s" % (instance.problem.parent.state, instance.problem.parent.name, instance.problem.name, file_name)
class Area(models.Model):