Skip to content

Instantly share code, notes, and snippets.

@jpassaro
jpassaro / Main.scala
Created April 14, 2022 20:30
spark bug reproduction
package example
import org.apache.spark.sql.SparkSession
import java.time.Instant
import org.apache.spark.sql.Dataset
import org.apache.spark.sql.{functions => F}
import org.apache.spark.sql.streaming.OutputMode
object Main extends App {
@jpassaro
jpassaro / 00-unicode-cheat-sheet.md
Last active April 17, 2024 20:18
Unicode cheat sheet

Unicode cheat sheet

A curated list of unicode characters I want to have quick reference toward, including their literal presentation (where possible), description from the unicode table, various representations, and how to enter it as a Vim digraph*.

They are grouped by category, including a link to the relevant Unicode block. Also see the full list of Unicode blocks

@jpassaro
jpassaro / git-save-build
Last active January 17, 2019 21:22
Maintain a separate branch for build artifacts
#!/bin/bash
# add to your PATH and call as
# $ git save-build [-d|--dirty] [<buildname>]
# <buildname> can be omitted if you configure a default value: git config build.save.default
# you must configure the following:
# build.save.<buildname>.cmd -- a command run when invoking this build profile
# build.save.<buildname>.dest -- a directory containing build artifacts
# build.save.<buildname>.branch -- a branch you want to track your build history on.
@jpassaro
jpassaro / assembly.xml
Created December 21, 2018 17:06
Strange behavior of assembly
<assembly>
<id>assembly</id>
<formats>
<format>dir</format>
</formats>
<files>
<file>
<source>content.txt</source>
<outputDirectory>/</outputDirectory>
<destName>filtered-content.txt</destName>
@jpassaro
jpassaro / hextable.py
Created May 29, 2018 20:20
print hex timestable
import binascii
for row in range(1, 16):
print(*map('{:3x}'.format, range(row, row*16, row)))
#!/usr/bin/env python3
from decimal import Decimal
import re
import yaml
from yaml.composer import Composer
from yaml.constructor import SafeConstructor
from yaml.parser import Parser
from yaml.reader import Reader
from yaml.resolver import BaseResolver, Resolver as DefaultResolver
@jpassaro
jpassaro / python console
Last active June 29, 2017 22:01
Example: using werkzeug cache with flask.render_template_string
>>> # flask shell
>>> from short_templates import *
>>> NameTemplate.render(site_name='Flask', name='John')
u'Thank you for visiting Flask. I am John.'
>>> NameDateTemplate.render(site_name='Flask', name='John')
u'Thank you for visiting Flask. I am John. Today is 2017-06-29.'