This file contains hidden or 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 generate_slug(name string) string { | |
mut slug := name | |
slug = slug.to_lower() | |
bad := 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;' | |
good := 'aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------' | |
for i := 0; i < utf8.len(bad); i++ { | |
bad_character := utf8.raw_index(bad, i) | |
good_character := utf8.raw_index(good, i) |
This file contains hidden or 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 | |
set -euo pipefail | |
IFS=$'\n\t' | |
echo "Waiting for Heroku release hash to equal HEAD..." | |
echo "Press [CTRL+C] to stop.." | |
while : | |
do | |
HEROKU_HASH=$(heroku releases | grep Deploy |head -n1 |cut -d ' ' -f4) |
This file contains hidden or 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
_yarn_complete() { | |
local cur_word prev_word scripts | |
cur_word="${COMP_WORDS[COMP_CWORD]}" | |
prev_word="${COMP_WORDS[COMP_CWORD-1]}" | |
scripts=$(jq '.scripts | keys[]' package.json | paste) | |
COMPREPLY=( $(compgen -W "${scripts}" -- ${cur_word}) ) | |
return 0 |
This file contains hidden or 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
#!/usr/bin/env bash | |
# WARNING: THIS ACTUALLY MADE ME FEEL A BIT SICK. Maybe make the sleeps longer below before you try this out | |
set -euo pipefail | |
IFS=$'\n\t' | |
HUE_IP=$(curl https://www.meethue.com/api/nupnp 2> /dev/null | cut -d '"' -f 8) | |
function create-hue-user() { |
This file contains hidden or 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
diff --git a/config.def.h b/config.def.h | |
index 82b1b09..8d46e57 100644 | |
--- a/config.def.h | |
+++ b/config.def.h | |
@@ -84,43 +84,49 @@ unsigned int tabspaces = 8; | |
/* Terminal colors (16 first used in escape sequence) */ | |
static const char *colorname[] = { | |
- /* 8 normal colors */ | |
- "black", |
This file contains hidden or 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
diff --git a/config.def.h b/config.def.h | |
index 82b1b09..db3781f 100644 | |
--- a/config.def.h | |
+++ b/config.def.h | |
@@ -85,30 +85,28 @@ unsigned int tabspaces = 8; | |
/* Terminal colors (16 first used in escape sequence) */ | |
static const char *colorname[] = { | |
/* 8 normal colors */ | |
- "black", | |
- "red3", |
This file contains hidden or 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
diff --git a/st.c b/st.c | |
index ae93ade..ff531a3 100644 | |
--- a/st.c | |
+++ b/st.c | |
@@ -218,6 +218,9 @@ char *opt_line = NULL; | |
char *opt_name = NULL; | |
char *opt_title = NULL; | |
int oldbutton = 3; /* button event on startup: 3 = release */ | |
+char *cwd = NULL; | |
+static char plumber[] = "plumb.sh"; |
This file contains hidden or 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
diff --git a/config.def.h b/config.def.h | |
index 82b1b09..db3781f 100644 | |
--- a/config.def.h | |
+++ b/config.def.h | |
@@ -85,30 +85,28 @@ unsigned int tabspaces = 8; | |
/* Terminal colors (16 first used in escape sequence) */ | |
static const char *colorname[] = { | |
/* 8 normal colors */ | |
- "black", | |
- "red3", |
This file contains hidden or 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
function! Levenshtein(first, second) | |
let f = [] | |
let mn = 0 | |
let fj = 0 | |
let ca = 0 | |
let fj1 = 0 | |
for i in range(len(a:second) + 1) | |
let f = add(f, i) | |
endfor |
This file contains hidden or 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
activities = Activity.includes(:product) | |
.order("product_id, created_at DESC") | |
.select("DISTINCT ON (product_id) activities.*") | |
.page(page).per(second_page_size).map do |activity| | |
activity.product.activity = activity | |
activity.product | |
end | |
NewerOlder