Skip to content

Instantly share code, notes, and snippets.

@lo48576
lo48576 / 20200505-mastodon-db-maintenance-log.md
Last active August 24, 2022 15:26
Mastodon 腐った DB 矯正メモ (2020-05-05) by らりお

Mastodon 腐った DB 矯正メモ (2020-05-05)

状況

@romainl
romainl / Don't use Vim.md
Last active May 14, 2024 14:09
Don't use Vim for the wrong reasons

Don't use Vim

Don't do the crime, if you can't do the time.

-- Anthony Vincenzo "Tony" Baretta

Vim is an amazing text editor. I love it. Really, I wouldn't [organize][organize] a Vim advent calendar if I didn't. But, as amazing as it is, Vim is not for everyone. It can't solve all your problems, or be a TUI version of your favorite IDE, or make you a better programmer, or land you that dream job in the Bay Area. But Vim can help you be more mindful, focused, and efficient, as long as you approach it with the right mindset.

Don't get me wrong, I certainly welcome you to try Vim, but I'm not a proselyte. I don't thrive on newbies. I just want you to use the right tool for the job and not waste your—and anyone's—time on a fruitless quest.

@jesster2k10
jesster2k10 / README.md
Last active May 6, 2024 18:16
Rails API Social Login

Rails API-Only Social Login

This is another piece of code I've extrapolated from a Ruby on Rails project I'm currently working on. The code implmenets social login with a RoR API-based application, targeted at API clients.

The setup does not involve any browser-redirects or sessions as you would have to use working with Omniauth. Instead, what it does is takes an access_token generated on client-side SDKs, retireves user info from the access token and creates a new user and Identity in the database.

This setup works with native applications as described in the Google iOS Sign In Docs (see Authenticating with a backend server)

@siberex
siberex / cancelot.sh
Last active July 14, 2022 03:03
Provides automation for cancelling previous ongoing Cloud Builds for the same branch/trigger
#!/usr/bin/env bash
# https://github.com/siberex/cancelot
#
# To download the latest version (if you trust running random bash scripts from the internets!):
# curl -L https://gist.github.com/siberex/bb0540b208019382d08732cc6dd59007/raw -o cancelot.sh && chmod +x cancelot.sh
#
# Provides automation for cancelling Cloud Builds
# Use as a first step to cancel previous builds currently in progress or queued for the same branch name and trigger id.
# Similar to: https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/cancelot
@itchyny
itchyny / go114-regression.md
Last active April 8, 2020 23:23
Go 1.14の主なregression

Go 1.14 の主なregressionです。1.14.1で修正されると思われます。

Rust Error Handling Cheatsheet - Result handling functions

Introduction to Rust error handling

Rust error handling is nice but obligatory. Which makes it sometimes plenty of code.

Functions return values of type Result that is "enumeration". In Rust enumeration means complex value that has alternatives and that alternative is shown with a tag.

Result is defined as Ok or Err. The definition is generic, and both alternatives have

#include <stdlib.h>
#include <stdio.h>
extern void* main_loop;
extern const char* Version;
extern int nvim_get_current_buf(void);
#define false ((_Bool)0)
@jaawerth
jaawerth / client.fnl
Last active January 6, 2020 17:16
first pass on wrapping nvim-client in Fennel to generate api functions w/ docstrings
; lie to gist's syntax highlight and say it's clojure
; vim: ft=clojure
(require-macros :fnl.fennel-nvim.macros.metadata)
(local (mpack Session Tcp) (values (require :mpack)
(require :nvim.session)
(require :nvim.tcp_stream)))
(local fmt string.format)
(fn get-api-doc []
(let [fh (io.open "./fnl/fennel-nvim/api.mpack")
@laiso
laiso / 中国とRubyメモ.md
Last active December 27, 2019 01:16
中国とRubyメモ

Ruby China

活発なRubyユーザーのコミュニティ

高まる中国のRuby熱---上海で初のRuby会議,まつもと氏も講演 | 日経 xTECH(クロステック)

2009年。日本のRubyコミュニティと近い時期に中国コミュニティも活発だった

中国を代表する企業であるECサイトのタオバオ(淘宝網)からは、2名のスピーカーが講演した。タオバオは、社内管理システムでRubyを使っているという。上海近郊の日本企業は、製品のプロトタイプの開発にRubyを使用して、実装はC系の言語で行っている。この会社からは新幹線で1時間以上かけて10名以上のエンジニアが参加した。 https://tech.nikkeibp.co.jp/it/article/COLUMN/20120115/378501/?ST=govtech

@bfredl
bfredl / tshl.lua
Last active February 29, 2020 13:59
cquery = [[
(ERROR) @ErrorMsg
"break" @keyword
"case" @keyword
"continue" @keyword
"do" @keyword
"else" @keyword
"for" @keyword
"if" @keyword