Skip to content

Instantly share code, notes, and snippets.

View djGrill's full-sized avatar
🚀

dAIvd djGrill

🚀
View GitHub Profile
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active July 29, 2024 09:18
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@coleturner
coleturner / Schema.test.js
Last active June 7, 2018 02:19
Quick Bootstrapping of Testing for Apollo Server
import {
makeExecutableSchema,
addMockFunctionsToSchema,
mockServer
} from 'graphql-tools';
const testCaseA = {
id: 'Test case A',
query: `
query {
@djGrill
djGrill / commands.sh
Last active June 13, 2024 11:37
Useful Rails Commands
rails new . \
--api \
--minimal \ # https://github.com/rails/rails/blob/4a4b3998300fbebf537b770d842066b13dee5072/railties/lib/rails/generators/rails/app/app_generator.rb
--skip-asset-pipeline \
--skip-bundle \
--skip-keeps \
--skip-listen \
--skip-spring \
--skip-sprockets \
--skip-test \
@alexedwards
alexedwards / main_test.go
Last active June 15, 2024 00:55
MaxOpenConns benchmark
package main
import (
"database/sql"
"testing"
"time"
_ "github.com/lib/pq"
)
@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active July 27, 2024 10:31
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@yalab
yalab / bootstrap-memo.md
Last active July 20, 2022 20:29
rails5 + webpacker + bootstrap
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add bootstrap@4.0.0-beta jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
@robvolk
robvolk / es6_fetch_example.js
Last active October 17, 2019 16:46
AJAX requests in ES6 using fetch()
// ES6 Fetch docs
// https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
fetch('https://some.url.com')
.then(response => {
if (response.ok) {
return Promise.resolve(response);
}
else {
return Promise.reject(new Error('Failed to load'));
@zulhfreelancer
zulhfreelancer / heroku_pg_db_reset.md
Last active June 17, 2024 11:44
How to reset PG Database on Heroku (for Rails app)?

It's important to note that running this reset will drop any existing data you have in the application

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

@nashirox
nashirox / rails-validates.rb
Last active May 31, 2024 04:11
Rubyのバリデーション用正規表現集
#
# 数字
#
# 全て数値(全角)
/\A[0-9]+\z/
# 全て数値(半角)
/\A[0-9]+\z/