My Atom config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To use this, put it in a folder, install ytdl-core with `npm i ytdl-core`, then create a ZIP with the content of the folder and deploy it. | |
// https://docs.aws.amazon.com/lambda/latest/dg/nodejs-package.html#nodejs-package-dependencies | |
var AWS = require('aws-sdk'); | |
const ytdl = require('ytdl-core'); | |
const stream = require('stream'); | |
var s3 = new AWS.S3(); | |
exports.handler = async (event, context, cb) => { | |
const { videoUrl, key, bucket } = event; |

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugsnagClient.notify(new Error('Page not found (404)'), { | |
beforeSend: (report) => { | |
report.groupingHash = report.request.url; | |
report.severity = 'info'; | |
}, | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { PropTypes as T } from 'prop-types'; | |
import videojs from 'video.js'; | |
// a component for use with videojs | |
// use it like this: | |
// <VideoPreview video={myVideo} key={myVideo.id} /> | |
export default class VideoPreview extends Component { | |
ref = React.createRef(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyObject < ActiveRecord::Base | |
class JsonValidator < ActiveModel::EachValidator | |
def initialize(options) | |
options.reverse_merge!(:message => :invalid) | |
super(options) | |
end | |
def validate_each(record, attribute_before_typecast, value) | |
attribute = attribute_before_typecast.to_s.sub('_before_type_cast', '') | |
value = value.strip if value.is_a?(String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export HOMEBREW_INSTALL_BADGE='🍵' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/setup' | |
require 'dino' | |
OUTPUT_PIN = 9 | |
module Dino | |
module Components | |
class Vibrator < BaseComponent | |
def output(value) | |
analog_write(self.pin, value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(doc) { | |
if(doc.SourceCase !== 'undefined'){ | |
emit(doc._id, { | |
lastName: doc.Surname, | |
otherNames: doc.OtherNames, | |
sourceCase: doc.SourceCase, | |
sourceCaseId: doc.sourcerCaseId | |
}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.directive 'ngPopup', [ -> | |
restrict: 'A' | |
link: (scope, element, attr) -> | |
element.click (e) -> | |
url = element.attr('href') | |
width = 575 | |
height = 400 | |
left = ($(window).width() - width) / 2 | |
top = ($(window).height() - height) / 2 |
NewerOlder