Instantly share code, notes, and snippets.

View omnivore_fixed_ds_stats.rb
# NOTE: run once on production, ideally after pr is merged to master, and first revenue stat is pullled.
# that way we can get all stats before revenue stat time, and update `old_stats_time` with appropriate time.
#
# Try on sandbox: `bundle exec rails c --sandbox`
# ======
omnivore_ds_ids = DataStream.where(source: "omnivore").pluck(:id)
transaction_stats_before = StoreStat.where(stat_type: "transactions", data_stream_id: omnivore_ds_ids).where("time < ?", Time.current.in_time_zone(Time.zone.name)); 0
revenue_stats_before = StoreStat.where(stat_type: "sales", data_stream_id: omnivore_ds_ids).where("time < ?", Time.current.in_time_zone(Time.zone.name)); 0
old_stats_time = Time.current.in_time_zone(Time.zone.name)
View gci_kdeconnect_testing.md
Brand Model Android Version Build Remote Input File Transfer (Desk2App) File Transfer (App2Desk) Reconnect (Desktop disruption) Reconnect (Phone disruption)
OnePlus 5T 8.1.0 lastStableBuild comments comments comments comments comments
OnePlus 5T 8.1.0 lastSuccessfulBuild comments comments comments comments comments
View webpack.config.js
var path = require('path')
var webpack = require('webpack')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
entry: './src/main.js',
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: 'build.js'
View output_log.txt
Log uploaded on Wednesday, October 17, 2018, 10:08:56 PM
Loaded mods:
Core: (no assemblies)
HugsLib[6.0.1]: 0Harmony(1.2.0.1), HugsLib(1.0.0.0)
Defensive Positions: $HugsLibChecker(0.5.0.0), DefensivePositions(1.6.1.0)
Allow Tool: $HugsLibChecker(0.5.0.0)
Colony Manager: 0Harmony(1.2.0.1), Fluffy_ColonyManager(4.1.415.0)
Hospitality[0.19.2]: $HugsLibChecker(0.5.0.0), Hospitality(1.0.1.0)
Expanded Prosthetics and Organ Engineering: (no assemblies)
EdB Prepare Carefully: 0Harmony(1.1.0.0), EdBPrepareCarefully(1.0.10.0)
View PostfixEvaluation.cpp
/*
Evaluation Of postfix Expression in C++
Input Postfix expression must be in a desired format.
Operands must be integers and there should be space in between two operands.
Only '+' , '-' , '*' and '/' operators are expected.
*/
#include<iostream>
#include<stack>
#include<string>
View massachusetts.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View unifi.service
[Unit]
Description=UniFi Container
After=network-online.target
[Service]
Type=simple
User=alc
Group=alc
ExecStart=/usr/bin/podman start -a unifi-sdn-controller
ExecStop=/usr/bin/podman stop unifi-sdn-controller
View collection.rss.liquid
{% layout none %}{% comment %}
/*
* Shopify Product RSS feed, also needs Cloudflare Workers
* for Content-Type fix to application/rss+xml, because
* Shopify only supports text/html
*
* Copyright (c) 2018 @fmt github.com/fmt
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*/
View ifelse.rb
x = 1
if x > 2
puts "x é maior que 2"
elsif x <= 2 and x!=1
puts "x é menor que 2 e diferente de 1"
else
puts "não sei o valor de x"
end
x = 1
View pipenv_completion.ps1
function TabExpansion($line, $lastWord) {
$lastBlock = [regex]::Split($line, '[|;]')[-1].TrimStart()
$aliases = @("pipenv") + @(Get-Alias | where { $_.Definition -eq "pipenv" } | select -Exp Name)
$aliasPattern = "($($aliases -join '|'))"
if($lastBlock -match "^$aliasPattern ") {
$Env:_PIPENV_COMPLETE = "complete-powershell"
$Env:COMMANDLINE = "$lastBlock"
(pipenv) | ? {$_.trim() -ne "" }
Remove-Item Env:_PIPENV_COMPLETE
Remove-Item Env:COMMANDLINE