This is a test component made in ember twiddle. To edit this component, go here: https://ember-twiddle.com/24863d7b4c2f7a912bfa7d5b9e0f3b3b
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
deb http://deb.debian.org/debian stretch main contrib non-free | |
deb-src http://deb.debian.org/debian stretch main contrib non-free | |
deb http://deb.debian.org/debian stretch-updates main contrib non-free | |
deb-src http://deb.debian.org/debian stretch-updates main contrib non-free | |
deb http://security.debian.org/ stretch/updates main contrib non-free | |
deb-src http://security.debian.org/ stretch/updates main contrib non-free |
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
var Whammy = require('node-whammy'), | |
sharp = require('sharp'); | |
function canvasToWebp(canvas, callback) { | |
sharp(canvas.toBuffer()).toFormat(sharp.format.webp).toBuffer(function(e, webpbuffer) { | |
var webpDataURL = 'data:image/webp;base64,' + webpbuffer.toString('base64'); | |
callback(webpDataURL); | |
}); |
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
var amqp = require('amqplib/callback_api'); | |
// if the connection is closed or fails to be established at all, we will reconnect | |
var amqpConn = null; | |
var pubChannel = null; | |
var offlinePubQueue = []; | |
var mq = { | |
// Main start |
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
# This is supposedly what CRIME by Juliano Rizzo and Thai Duong will do | |
# Algorithm by Thomas Pornin, coding by xorninja, improved by @kkotowicz | |
# http://security.blogoverflow.com/2012/09/how-can-you-protect-yourself-from-crime-beasts-successor/ | |
import string | |
import zlib | |
import sys | |
import random | |
charset = string.letters + string.digits + "%/+=" |
Install rabbitmq first: http://www.rabbitmq.com/download.html
Or brew install rabbitmq
on Mac
Start it up with rabbitmq-server
Install gems to talk to the message queue:
gem install bunny
gem install amqp
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
#!/usr/bin/env python | |
from flask import Flask, jsonify, request, render_template, abort | |
from text.blob import TextBlob | |
from text.utils import strip_punc | |
app = Flask(__name__) | |
##### TextBlob API ##### | |
@app.route("/api/sentiment", methods=['POST']) | |
def sentiment(): |
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
def thing | |
if !this && that == true | |
if theother.count > 44 && yo.present? | |
# do this thing!! | |
end | |
end | |
end | |
def thing_2 | |
if (!this && that == true) and (theother.count > 44 && yo.present?) |
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 Numeric | |
def to_grade | |
case self | |
when 97..100; grade = 'A+' | |
when 94..96; grade = 'A' | |
when 90..93; grade = 'A-' | |
when 87..89; grade = 'B+' | |
when 84..86; grade = 'B' | |
when 80..83; grade = 'B-' | |
when 77..79; grade = 'C+' |
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
# add this to your config.rb | |
ready do | |
wikitargets = Hash.new | |
wikiwords = Hash.new | |
sitemap.resources.select {|p| p.ext == ".html" }.each do |p| | |
unless p.data['wikitag'].nil? | |
wikitargets[p.data['wikitag']] = p.url | |
end |