gem install rails --pre
rails new my_app -T
require File.dirname(__FILE__) + '/spec_helper' | |
describe "The library itself" do | |
Spec::Matchers.define :have_no_tab_characters do | |
match do |filename| | |
@failing_lines = [] | |
File.readlines(filename).each_with_index do |line,number| | |
@failing_lines << number + 1 if line =~ /\t/ | |
end | |
@failing_lines.empty? |
If you import live data into Google Docs spreadsheets using the importdata function and you want to force a refresh at a certain interval, but you also want to ensure that some cache-busting goes on, append a querystring that's the epoch time value that the refresh occurs, so for a sheet that should grab new data every hour you could force an update like this:
importData("http://example.com/data.csv?" & hour(googleclock()) & ")")
But the url requested looks like this: http://example.com/data.csv?11
if the refresh happened at 11am. The next day at 11, the url will be the same, so there's a chance you may get cached data. To get around this, use an epoch time-based refresh. The formula:
=((date(year(googleclock()),month(googleclock()),day(googleclock())) & " " & time(hour(googleclock()), 0, 0)) - DATE( 1970;1;1))*86400
gives you the epoch timestamp for the time at the current hour. If you wanted the timest
#!/usr/bin/env python3.5 | |
import socket | |
import asyncio | |
from struct import pack, unpack | |
class Client(asyncio.Protocol): | |
def connection_made(self, transport): | |
self.transport = transport | |
self.server_transport = None |
If you've built ffmpeg as instructed here on Linux and the ffmpeg binary is in your path, you can do fast HEVC encodes as shown below, using NVIDIA's NPP's libraries to vastly speed up the process.
Now, to do a simple NVENC encode in 1080p, (that will even work for Maxwell Gen 2 (GM200x) series), start with:
ffmpeg -i <inputfile> -pass 1 \
-filter:v hwupload_cuda,scale_npp=w=1920:h=1080:format=nv12:interp_algo=lanczos,hwdownload,format=nv12 \
-c:v hevc_nvenc -profile main -preset slow -rc vbr_2pass \
I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.
For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.
Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.