Skip to content

Instantly share code, notes, and snippets.

View ojczeo's full-sized avatar
🖖
awesoming stuff

ojczeo

🖖
awesoming stuff
View GitHub Profile
@tenthree
tenthree / fake-images.js
Created June 24, 2019 08:22
fake-images middleware for local development
module.exports = function () {
//
// [ express middleware ]
// Generate a /fake/images route for testing images source
//
// images service origin:
// - PICSUM(https://picsum.photos)
// Created by David Marby & Nijiko Yonskai
// Having trouble? Poke @DMarby on Twitter
// Images from unsplash
@tzmartin
tzmartin / embedded-file-viewer.md
Last active May 1, 2024 14:41
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@ajardin
ajardin / capture.html
Created February 8, 2016 08:51
Capture a thumbnail from a video with JavaScript.
<!DOCTYPE html>
<head>
<script type='text/javascript'>
window.onload = function () {
var video = document.getElementById('videoId');
var canvas = document.getElementById('canvasId');
var img = document.getElementById('imgId');
video.addEventListener('play', function () {
canvas.style.display = 'none';
@ejdyksen
ejdyksen / patch-edid.md
Last active April 6, 2024 15:59
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@huydx
huydx / visualizer.js
Created May 5, 2013 14:51
visualizer.js
(function(){
window.onload = init;
function init() {
var context = new webkitAudioContext();
var audiobuffer;
var sourceNode;
var analyzer;
window.javascriptnode = null;