Skip to content

Instantly share code, notes, and snippets.

View typeoneerror's full-sized avatar
🤠
iOS, Capacitor, Ember, Vue, Rails

Benjamin Borowski typeoneerror

🤠
iOS, Capacitor, Ember, Vue, Rails
View GitHub Profile
@typeoneerror
typeoneerror / image-upload-example.hbs
Last active August 29, 2015 14:15
image upload handlebars
{{image-upload-display value=profile.avatar label="Profile Picture" endpoint="users/avatar"}}
{{image-upload-display value=course.avatar label="Avatar Image" endpoint="course/upload" width="800" height="600"}}
{{image-upload-display value=course.banner label="Banner Image" endpoint="course/upload" width="1200" height="400"}}
class Thingy
constructor: (@onBeforeSendCallback) ->
console.log "Yay"
XHRWatcherOnBeforeSend: (sendParams) ->
@onBeforeSendCallback() if onBeforeSendCallback?
@typeoneerror
typeoneerror / _sidebar.scss
Created February 16, 2015 19:35
sidebar css waterfall
.sidebar-animated {
nav {
@for $n from 1 through 6 {
> li:nth-child(#{$n}) {
.nav-label, > a > .ss-icon { transition-delay: #{$n*60}ms; }
}
}
}
}
contentSecurityPolicy: {
'default-src': "'none'",
'script-src': "'self' 'unsafe-eval' 'unsafe-inline' intercom.io w.soundcloud.com",
'object-src': "'self'",
'font-src': "'self' data: fonts.gstatic.com",
'connect-src': "'self' soundcloud.com",
'img-src': "'self' data:",
'style-src': "'self' 'unsafe-inline' fonts.googleapis.com",
'media-src': "'self'",
'frame-src': "'self' w.soundcloud.com youtube.com youtube-nocookie.com"
@typeoneerror
typeoneerror / .jscsrc.json
Last active August 29, 2015 14:17
.jscsrc
{
"disallowEmptyBlocks": true,
"disallowMixedSpacesAndTabs": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowQuotedKeysInObjects": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInCallExpression": true,
// router.js
import Ember from 'ember';
import config from './config/environment';
let Router = Ember.Router.extend({
location: config.locationType
});
@typeoneerror
typeoneerror / resp.txt
Last active August 29, 2015 14:19
dear recruiter,
Your recruiters are sending unsolicited emails with no way to opt-out of these emails. They are also being sent as bulk emails to multiple participants, not even addressing candidates by name. I cannot imagine you get very good results sending form letters to potential candidates, just as you probably don't recommend job seekers send in resume cover letters with "DEAR COMPANY," as a lead-in.
I'd appreciate your review of the CAN-SPAM act with regards to these types of emails: https://www.ftc.gov/tips-advice/business-center/guidance/can-spam-act-compliance-guide-business
Please make sure my email is 100% removed from your system. I do not wish to be contacted by another of your recruiters.
{
"settings": {
"todoreview": {
"case_sensitive": true,
"patterns": {
"HIGH": "HIGH[\\s]*?:[\\s]*(?P<high>.*)$",
"TODO": "TODO[\\s]*?:[\\s]*(?P<todo>.*)$",
"NOTE": "NOTE[\\s]*?:[\\s]*(?P<note>.*)$",
"FIXME": "FIX ?ME[\\s]*?:[\\s]*(?P<fixme>.*)$",
"CHANGED": "CHANGED[\\s]*?:[\\s]*(?P<changed>.*)$"
@typeoneerror
typeoneerror / first_or_initalize.rb
Last active August 29, 2015 14:20
first_or_initialize_wtf
# Does not work
progress = DokiCore::Progress.where(user: user, course: course)
.first_or_initialize(progressable: progressable)
puts progress.valid? # false
puts progress.errors.to_a # ['course is blank', 'user is blank']
pp progress # { course_id: 1, user_id: 1 } <<------- WTF!
# Works
progress = DokiCore::Progress.where(user: user, course: course).first
WebDeveloper.Information.displayFocusTarget = function(display, documents)
{
var contentDocument = null;
var bodyDocument = null;
var elements = null;
var focusables = 'a[href], *[tabindex], area, button, iframe, input, select, textarea';
for(var i = 0, l = documents.length; i < l; i++)
{
contentDocument = documents[i];