This file contains hidden or 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
| fname=/home/zorbash/Pictures/interval/`date +"%m_%d_%y_%H%M%S"` | |
| fswebcam -r 640x480 --jpeg 85 ${fname}.jpg | |
| convert ${fname}.jpg -resize 1920x1080 ${fname}.jpg | |
| export DISPLAY=:3 | |
| scrot ${fname}s.jpg | |
| montage -mode concatenate -tile 1x ${fname}s.jpg ${fname}.jpg ${fname}_combined.jpg |
This file contains hidden or 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
| server { | |
| location /songs/random { | |
| mruby_content_handler '/var/www/apps/songs/random.rb'; | |
| } | |
| location /words/random { | |
| mruby_content_handler '/var/www/apps/words/random.rb'; | |
| } | |
| } |
This file contains hidden or 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
| begin | |
| word = `shuf /usr/share/dict/words | head -1`.chomp | |
| Nginx::rputs JSON::stringify({ word: word}) | |
| rescue Exception => e | |
| Ngixn::rputs e | |
| end |
This file contains hidden or 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 'sinatra' | |
| require 'json' | |
| require 'sqlite3' | |
| get '/songs/random' do | |
| db = SQLite3::Database.new '/var/www/apps/shared/songs.db' | |
| row = db.execute('SELECT * FROM songs ORDER BY RANDOM() LIMIT 1;')[0] | |
| song = { | |
| id: row[0], |
This file contains hidden or 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
| express = require('express'); | |
| sqlite3 = require('sqlite3').verbose(); | |
| http = require('http'); | |
| exec = require('child_process').exec; | |
| db = new sqlite3.Database('/var/www/apps/shared/songs.db'); | |
| app = express(); | |
| app.listen(9999); |
This file contains hidden or 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 MainController < ApplicationController | |
| def songs_random | |
| row = ActiveRecord::Base.connection | |
| .execute("SELECT * FROM songs ORDER BY RANDOM() LIMIT 1;")[0] | |
| render json: { song: row.delete_if { |key, _| key.to_s =~ /^[0-9]+$/ } } | |
| end | |
| def words_random | |
| render json: { word: `shuf /usr/share/dict/words | head -1`.chomp } |
This file contains hidden or 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 'oauth2' | |
| require 'net/http' | |
| require 'json' | |
| CID = 'my_cid' | |
| PAS = 'my_pass' | |
| RDR = 'rdr_url' | |
| # OAuth2 client object | |
| def client |
This file contains hidden or 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
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.box = 'debian_jessie_64' | |
| config.vm.box_url = 'http://vagrant.zorbash.com/boxes/debian_jessie_64.box' | |
| # Make the vm accessible at the defined ip | |
| config.vm.network :private_network, ip: "192.168.77.35" | |
| config.vm.network :forwarded_port, guest: 22, host: 11234 |
This file contains hidden or 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
| { | |
| "remove-empty-rulesets": true, | |
| "always-semicolon": true, | |
| "color-case": "lower", | |
| "block-indent": " ", | |
| "element-case": "lower", | |
| "leading-zero": false, | |
| "quotes": "single", | |
| "space-before-colon": "", | |
| "space-after-colon": " ", |
This file contains hidden or 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
| -webkit-border-radius: 1px; | |
| -moz-border-radius: 1px; | |
| border-radius: 1px; |
OlderNewer