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
# RingBuffer class: | |
# https://github.com/celluloid/celluloid/blob/master/lib/celluloid/logging/ring_buffer.rb | |
# added the moving average method | |
class RingBuffer | |
attr_reader :buffer | |
def initialize(size) | |
@size = size |
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 './ring_buffer.rb' | |
iterations = 1000 | |
RING_SIZE = 25 | |
ring = RingBuffer.new(RING_SIZE) | |
iterations.times do |i| | |
time_start = Time.now | |
400000.times do |t| |
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
/* Stolen from here: https://esausilva.com/2017/02/21/filter-select-list-options-typeahead-in-javascript-es6/ */ | |
/* Added document.getElementByID instead of querySelectorAll | |
<html> | |
<head> | |
<style> | |
div { | |
width: 280px; | |
margin: 10 auto; | |
} | |
input { |
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
c:\gswin32c.exe -sDEVICE=pdfwrite \ | |
-dNOPAUSE \ | |
-dBATCH \ | |
-dSAFER \ | |
-dCompatibilityLevel=1.6 \ | |
-dPDFSETTINGS=/prepress | |
-dEmbedAllFonts=true \ | |
-dSubsetFonts=false \ | |
-dFirstPage=1 -dLastPage=100 \ |
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
Rescue Commands in Postgresql | |
#start with: | |
$sudo su postgres | |
$psql | |
#then do : | |
#show all databases | |
\dl |
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 RTCPeerConnection = null; | |
var getUserMedia = null; | |
var attachMediaStream = null; | |
var reattachMediaStream = null; | |
var webrtcDetectedBrowser = null; | |
var webrtcDetectedVersion = null; | |
function trace(text) { | |
if (text[text.length - 1] === "\n") { | |
text = text.substring(0, text.length - 1); |
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
#cache_store.yml file: | |
production: | |
cache_store: redis_store | |
servers: | |
- redis://localhost | |
database: 1 | |
#redis.yml file: | |
production: |
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
# canvas-lms/config/unicorn.rb: | |
# Sample verbose configuration file for Unicorn (not Rack) | |
# | |
# This configuration file documents many features of Unicorn | |
# that may not be needed for some applications. See | |
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb | |
# for a much simpler configuration file. | |
# | |
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete | |
# documentation. |
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
#/opt/nginx/conf/nginx.conf | |
user nginx; | |
worker_processes 4; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
pid logs/nginx.pid; |
NewerOlder