Skip to content

Instantly share code, notes, and snippets.

View yuta17's full-sized avatar

Hassan yuta17

  • Freelance
  • Tokyo
View GitHub Profile
@yuta17
yuta17 / settings.json
Last active August 5, 2023 05:42
settings.json
{
"git.terminalAuthentication": false,
"git.openRepositoryInParentFolders": "always",
"editor.inlineSuggest.enabled": true,
"editor.cursorBlinking": "solid",
"editor.tabSize": 2,
"editor.fontFamily": "Monaco",
"editor.fontSize": 12,
"editor.insertSpaces": true,
"editor.formatOnSave": true,
@yuta17
yuta17 / cloudSettings
Last active June 16, 2020 06:33
cloudSettings
{"lastUpload":"2020-01-19T13:32:49.974Z","extensionVersion":"v3.1.2"}
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'logger'
gem 'aws-sdk-s3'
gem 'parallel'
end
class ImageSync
@yuta17
yuta17 / vim-heroku.sh
Created September 17, 2018 05:10 — forked from dvdbng/vim-heroku.sh
Run vim in heroku updated 2017
mkdir ~/vim
cd ~/vim
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim
# Compiled on Jul 20 2017
curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz
export VIMRUNTIME="$HOME/vim/runtime"
export PATH="$HOME/vim:$PATH"
cd -
@yuta17
yuta17 / keybindings.json
Created September 10, 2018 10:21
user settings for vscode
// 既定値を上書きするには、このファイル内にキー バインドを挿入します
[
{
"key": "ctrl+k",
"command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "cmd+/",
"command": "-editor.action.commentLine",
@yuta17
yuta17 / gist:330ea5bfd3611b3b9255db44c01f2c4c
Created July 21, 2018 05:03
connect database (tunnel ssh) by nodejs
'use strict';
const https = require('https');
const mysql = require('mysql2');
const ssh2Client = require('ssh2').Client;
const ssh = new ssh2Client();
const dbHost = '';
const dbUser = '';
const dbPassword = '';
@yuta17
yuta17 / prevent double click
Last active July 12, 2018 14:23
prevent double click jquery
$(function () {
$('form').submit(function () {
const form = $(this);
if (form.hasClass('prevent-double-click')) {
event.preventDefault();
} else {
form.addClass('prevent-double-click');
}
});
});
@yuta17
yuta17 / sort_by_jquery.js
Created June 7, 2018 01:22
sort by jquery
$(function() {
$('#lists li').sort(function (list) {
if ($(list).find('.target-object')[0]) {
return 1;
} else {
return -1;
}
}).appendTo('#lists');
});
nginx -> puma -> rails
nginx
netstat -anp | grep LISTEN
tail -f /var/log/nginx/access.log
@yuta17
yuta17 / bar.rb
Created December 15, 2017 11:40
class << self のイディオム
# いつもの定義
# class Bar
# def hello
# puts 'hello'
# end
# end
# rubyの理解
Bar = Class.new do
def hello