Skip to content

Instantly share code, notes, and snippets.

@przmv
przmv / README.md
Created February 5, 2021 19:00
Google App Engine Standard environment runtime sizes comparison

Test case

// index.html
<h1>Hello, world!</h1>
// app.yaml
runtime: ${RUNTIME}
@przmv
przmv / LXQt.hs
Created July 16, 2020 20:49
My XMonad + LXQt config
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
module XMonad.Config.LXQt (
-- * Usage
-- $usage
lxqtConfig,
desktopLayoutModifiers
) where
import XMonad
@przmv
przmv / email_check.go
Created July 2, 2020 13:54
Check if lines of the provided files are valid email addresses. Regular expression for checking emails is from the awsome book “Let's Go!” by Alex Edwards — https://lets-go.alexedwards.net/
package main
import (
"bufio"
"fmt"
"os"
"regexp"
)
var EmailRX = regexp.MustCompile("^[a-zA-Z0-9\\.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
@przmv
przmv / csv.R
Created July 2, 2020 13:47
Convert all xls[x] files in the current directory to CSV
#!/usr/bin/env Rscript
library(readxl)
pattern <- ".xls[x]?$"
# Create a vector of Excel files to read
files_to_read = list.files(pattern=pattern)
# Read each file and write it to CSV
import System.Posix.Env (getEnv)
import Data.Maybe (maybe)
import XMonad
import XMonad.Config.Desktop
import XMonad.Config.Gnome
import XMonad.Config.Kde
import XMonad.Config.Mate
import XMonad.Config.Xfce

Keybase proof

I hereby claim:

  • I am pshevtsov on github.
  • I am pshevtsov (https://keybase.io/pshevtsov) on keybase.
  • I have a public key ASDPcdbEgEoNZXQVYAnwyHpD2_Tf6zQuslEFJXw83_u4hgo

To claim this, I am signing this object:

@przmv
przmv / rebuild.R
Created February 26, 2018 11:21
Rebuild Dygraphs for R project and docs
#!/usr/bin/env Rscript
library(roxygen2)
library(rmarkdown)
pkg <- "dygraphs"
roxygen2::roxygenize(pkg)
install.packages(pkg, repos = NULL, type = "source")
rmarkdown::render_site(paste(pkg, "docs", sep = "/"))
@przmv
przmv / glow_bench.go
Created April 6, 2016 19:31
gonx vs glow
package main
import (
"crypto/md5"
"flag"
"fmt"
"strings"
"github.com/chrislusf/glow/flow"
)
@przmv
przmv / interval.go
Created May 25, 2015 09:14
gonx interval reducer
package elblog
import (
"time"
"github.com/pshevtsov/gonx"
)
const (
IntervalHourly = -1 * time.Hour
@przmv
przmv / jsonval.sh
Created January 30, 2014 09:46 — forked from cjus/jsonval.sh
#!/bin/bash
function jsonval {
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
echo ${temp##*|}
}
json=`curl -s -X GET http://twitter.com/users/show/$1.json`
prop='profile_image_url'
picurl=`jsonval`