This file contains 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
fn row_count(input: &Vec<String>) -> usize { | |
let mut last: u8 = 0; | |
let mut count = 0; | |
for b in input { | |
for c in b.as_bytes() { | |
if (last == 13) && (*c == 10) { | |
continue; | |
} | |
if (*c == 10) || (*c == 13) { | |
count = count + 1; |
This file contains 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
type person = { | |
age: int, | |
name: string, | |
}; | |
type monster = { | |
age: int, | |
hasTentacles: bool, | |
}; | |
type entity = | |
| Person(person) |
This file contains 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
<?xml version="1.0" ?> | |
<template encoding-version="1.1"> | |
<description>Execute Clojurescript within NiFi</description> | |
<groupId>3516eb9e-0162-1000-5f97-f029d2608959</groupId> | |
<name>clojurescript-test</name> | |
<snippet> | |
<connections> | |
<id>9a6849f0-38e1-32bb-0000-000000000000</id> | |
<parentGroupId>251f069b-c168-3d56-0000-000000000000</parentGroupId> | |
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold> |
This file contains 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
select | |
nsp.nspname as schema_name, | |
nsp.nspacl as schema_acl, | |
cls.relname as object_name, | |
rol.rolname as object_owner, | |
case cls.relkind | |
when 'r' then 'TABLE' | |
when 'm' then 'MATERIALIZED_VIEW' | |
when 'i' then 'INDEX' | |
when 'S' then 'SEQUENCE' |
This file contains 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
with | |
table_list as (select table_catalog, table_schema, table_name from information_schema.tables where table_schema not in ('information_schema', 'pg_catalog')), | |
permissions as ( | |
select | |
grantee, | |
table_catalog, | |
table_schema, | |
table_name, | |
is_grantable, | |
privilege_type::varchar |
This file contains 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
FROM php:7.2.2-apache | |
RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pgsql | |
COPY ./ /var/www/html |
This file contains 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
package main | |
import ( | |
"golang.org/x/tour/tree" | |
"fmt" | |
) | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. | |
func Walk(t *tree.Tree, ch chan int) { |
This file contains 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
package main | |
// from https://tour.golang.org/methods/25 | |
import ( | |
"golang.org/x/tour/pic"; | |
"image"; | |
"image/color" | |
) |
This file contains 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
#!/bin/bash | |
MAX_SIZE=1920 | |
RAWS=$(find | grep RW2 | grep -v '\.jpg\.RW2') | |
for RAW in $RAWS; do | |
LOCKFILE=$(echo "$RAW" | sed 's/\.RW2$/.jpg.RW2/') | |
OUTFILE=$(echo "$RAW" | sed 's/\.RW2$/.jpg/') | |
echo $OUTFILE | |
if [ ! -e "$OUTFILE" ]; then |
This file contains 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
# from https://twitter.com/jpetazzo/status/347431091415703552 | |
docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs docker rm |
NewerOlder