Skip to content

Instantly share code, notes, and snippets.

View eatgrass's full-sized avatar
🌴
On vacation

Eatgrass eatgrass

🌴
On vacation
View GitHub Profile
@eatgrass
eatgrass / MOC - Pomodoros View.md
Created November 24, 2023 14:47
Obsidian Pomodoros Task Tracking

Task Summary View

const pages = dv.pages()
const emoji = '🍅'
dv.table(
["Task", "Pomodoros", "Time"],
pages.file.tasks
.filter(task => task.children.some(child=> child[emoji]))
.map(task=> {
{
"input": "http://s3.amazonaws.com/zencodertesting/test.mov",
"outputs": [
{
"label": "mp4-1500k",
"prepare_for_segmenting": ["hls", "dash"],
"audio_bitrate": 128,
"video_bitrate": 1100,
"size": "1280x720",
"url": "s3://my-bucket/mp4/1500.mp4"
@eatgrass
eatgrass / hhkb_remap.ahk
Last active May 26, 2022 15:40
My autohotkey script for HHKB
#MaxHotkeysPerInterval 200
ModActivateDelay := 100
*Space::
If SpacePressed ; AutoRepeat defense
Return
SpacePressed:=true
SetTimer ModActivate, % "-" ModActivateDelay
Return
@eatgrass
eatgrass / git lg
Created April 27, 2018 09:02
git lg alias for log
alias.lg=log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
@eatgrass
eatgrass / Types.java
Created March 18, 2018 13:04
return type resolver
/**
* Static methods for working with types.
*
* @author Bob Lee
* @author Jesse Wilson
*/
final class Types {
private static final Type[] EMPTY_TYPE_ARRAY = new Type[0];
@eatgrass
eatgrass / interval.sql
Created August 29, 2017 09:47
select with given interval
-- 1 week ago
SELECT * FROM table WHERE inputtime>DATE_SUB(CURDATE(), INTERVAL 1 WEEK)
-- 1 year ago
select *,YEAR(dateTime) from table where year(dateTime)=year(date_sub(now(),interval 1 year));
sudo -u admin /usr/local/java/bin/jps -mlvV
@eatgrass
eatgrass / connection state.sh
Last active February 28, 2017 01:20
net state
netstat -nat|grep 8080|awk '{print $6}' |sort|uniq -c|sort -rn
lsof -i:8080|awk '{print $10}' |sort|uniq -c|sort -rn
@eatgrass
eatgrass / OneToManyMapper.java
Last active December 23, 2016 08:58
Mybatis OneToMany Example
public interface ClassADAO {
@Select("SELECT id, name, description FROM TableA WHERE id = #{id}")
@Results({@Result(property = "id", column = "id"),
@Result(property = "list", javaType = List.class, column = "id",
many = @Many(select = "ClassBDao.getClassBForClassA"))})
ClassA getClassAById(@Param("id") long id);
}
mysqld --verbose --help | grep -A 1 'Default options'