Skip to content

Instantly share code, notes, and snippets.

View NuckChorris's full-sized avatar

Emma Lejeck NuckChorris

View GitHub Profile
class Anime
pg_search_scope :search,
against: { title: 'A', alt_title: 'A', synopsis: 'C' },
using: {
tsearch: {
prefix: true,
# Normalize to string length and scale to 0..1
normalization: 32,
dictionary: 'english'
},
  • Ember: See if we can simplify StoryController#isOnGroupPage
  • Ember: Clarify Story#canDeleteStory's conditional
  • Ember: Nuke group management page and replace with button to delete group (for site admins)
  • Ember: Remove all remaining references to group.closed
  • CSS: Rename community-widget.css.scss to dashboard-widgets.css.scss
  • Rails: Change Paperclip URL scheme to /group_avatar/:group_id.:ext
  • Rails: Change GroupMember#update_counter_cache! to use atomic incr/decr
  • Rails: Deduplicate Trending systems
  • Rails: Add pg_search to groups
  • Rails: Remove group_members index on group_id
@NuckChorris
NuckChorris / array.js
Last active February 12, 2018 19:47 — forked from pixelhandler/transforms.js
In Ember-CLI, transforms are located in app/transforms/name.js
// app/transforms/array.js
import Ember from 'ember';
import DS from 'ember-data';
export default DS.Transform.extend({
deserialize: function(value) {
if (Ember.isArray(value)) {
return Ember.A(value);
} else {
return Ember.A();

Here's how it's going to look like from the end user perspective:

1 hour before my PRO membership ends, if I am on a recurring plan Hummingbird will try to charge my credit card. If it succeeds everything is good. If it fails my subscription will run out and Hummingbird will try to charge my credit card again tomorrow, 3 days from now and 5 days from now. I will receive an email from Hummingbird if the charge is successful, and a different email every time charging my card fails.

{
"pack": {
"hira-vowels": {
"name": "Vowels",
"cards": [
{ "id": "e", "front": "え", "back": "e" },
{ "id": "a", "front": "あ", "back": "a" },
{ "id": "i", "front": "い", "back": "i" },
{ "id": "o", "front": "お", "back": "o" },
{ "id": "u", "front": "う", "back": "u" }
<?xml version="1.0" encoding="utf-8" ?>
<GameState xmlns="http://static.plejeck.com/apps/lurn/gamestate.xsd">
<Pack id="hiragana-basic">
<Card id="hira-vowels:e" value="12314" />
<Card id="hira-vowels:a" value="43142" />
</Pack>
<Setting id="flipped" value="true" />
<Setting id="timer" value="true" />
<Setting id="adaptive-timer" value="true" />
<State id="deck" value="hiragana-basic:hira-vowels,hiragana-basic:hira-k" />
desc "Bulk import info from TVDB"
task :bulk_import_tvdb, [:shows] => [:environment] do |t, args|
require 'parallel'
ActiveRecord::Base.connection_pool.disconnect!
config = ActiveRecord::Base.configurations[Rails.env]
config['pool'] = 20
ActiveRecord::Base.establish_connection(config)
# This fixes some threaded autoloading issues
require 'oj'
class HummingbirdListImport
include Enumerable
# Most ListImport systems shouldn't need a `list` parameter, since they separate manga and anime
# exports. We do, since our backups contain your whole library.
def initialize(str, list)
@list = Oj.load(str)[list.to_s]
# The class of the database we're matching against
/**
* This class represents a possible question
*/
class Question {
constructor(question, answer) {
}
}
/**
* This class represents a possible answer
var path = require('path');
var gulp = require('gulp');
var esnext = require('gulp-esnext');
var es6moduleTranspiler = require('gulp-es6-module-transpiler');
var uglify = require('gulp-uglify');
var less = require('gulp-less');
var sourcemaps = require('gulp-sourcemaps');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var bowerFiles = require('main-bower-files');