Skip to content

Instantly share code, notes, and snippets.

🌴
Probably In Salesforce Park

Peter Lejeck NuckChorris

🌴
Probably In Salesforce Park
Block or report user

Report or block NuckChorris

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:68577f374e407d55a173c1a86c9a9dc7
{
"id": 1,
"title": {
"name": "Tower of God",
"slug": "tower-of-god",
"origin": "Korean"
},
"related": [],
"alt_titles": [
"Dievo Bokštas",
View keybase.md

Keybase proof

I hereby claim:

  • I am nuckchorris on github.
  • I am nuck (https://keybase.io/nuck) on keybase.
  • I have a public key ASDUSpEGtrP2v1-XRzkR1VzTLq5HcTZuxBwCPo8b-T8mJgo

To claim this, I am signing this object:

View yardoc_cheatsheet.md
View nginx.conf
server {
listen 80;
# Proxy settings
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded_For $proxy_add_x_forwarded_for;
location /api/ {
View authenticators.github.js
import Ember from 'ember';
import ToriiAuthenticator from 'ember-simple-auth/authenticators/torii';
export default ToriiAuthenticator.extend({
torii: Ember.inject.service(),
authenticate() {
return this._super('github-oauth2', ...arguments);
}
});
View ioslocaleidentifiers.tsv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
View anime_resource.rb
class AnimeResource < JSONAPI::Resource
# Specify the Chewy index class to utilize for search queries
index MediaIndex::Anime
# Queries are extracted from params[:filter] and used to form an ElasticSearch query
# If there are no query filters in the params, skips the entire ES query step
query :season, verify: -> (values, _ctx) { values.in? Anime::SEASONS }
query :year
# Filters will often be unnecessary, since most things Postgres can do, Elastic can too.
# However, any filters declared will be applied after internal conversion from ElasticSearch to ActiveModel
View _model.class.php
<?php
include_once 'classes/db.class.php';
/**
* This is an ORM.
* I may have gone a bit overboard on this final project.
* I just got tired of constantly dropping into raw SQL for mundane crap.
*/
class Model {
private $_attributes = array();
@NuckChorris
NuckChorris / contracts.js.es6
Last active Aug 29, 2015
Contracts implemented in ~25 LOC
View contracts.js.es6
/*
* Released under the MIT License
*
* Copyright (c) 2014 Peter Lejeck
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
View gist:5b3502a8a35882161a98
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'
},
You can’t perform that action at this time.