Skip to content

Instantly share code, notes, and snippets.

View YasuhiroYoshida's full-sized avatar
🎯
Focusing

Yasuhiro Yoshida YasuhiroYoshida

🎯
Focusing
View GitHub Profile
@YasuhiroYoshida
YasuhiroYoshida / cloudSettings
Last active November 2, 2021 20:29
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-11-02T20:29:36.176Z","extensionVersion":"v3.4.3"}
@YasuhiroYoshida
YasuhiroYoshida / twoSum.js
Last active April 14, 2021 12:28
LeetCode: Two Sum (https://leetcode.com/problems/two-sum/) submitted and accepted at 2021-03-26 20:56
/**
* LeetCode
* Two Sum (https://leetcode.com/problems/two-sum/)
*
* Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
*
* You may assume that each input would have exactly one solution, and you may not use the same element twice.
*
* You can return the answer in any order.
*
@YasuhiroYoshida
YasuhiroYoshida / DatasetFileSplitter.swift
Last active April 13, 2021 21:58
Snippet to split a dataset file in csv format into training data file and testing data file from terminal
/**
This splits a dataset file in csv format into two files,
"training data file" and "testing data file,"
at the same location as the original file,
using MLDataTable#randomSplit.
Put this in a new file and run it on terminal.
Example:
$ swift thisFile.swift originalFile.csv 0.8 5
@YasuhiroYoshida
YasuhiroYoshida / Dockerfile
Last active April 14, 2021 12:08
Dockerfile for a Rails project with Ruby 2.7.1 with jemalloc built on Debian 10 (USER ≠ root)
FROM debian:buster-slim
ARG RUBY_VERSION=2.7.1-jemalloc
# RUN with pipe recommendation: https://github.com/hadolint/hadolint/wiki/DL4006
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update -q \
&& apt-get dist-upgrade --assume-yes \
&& apt-get install --assume-yes -q --no-install-recommends \
curl \
<?php
// src/Acme/TweetBundle/Controller/DefaultController.php
namespace Acme\TweetBundle\Controller;
use Symfony\Component\ClassLoader\UniversalClassLoader;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Themattharris\TmhOAuth;
use Acme\TweetBundle\Entity\SearchWord;
use Acme\TweetBundle\Entity\Makeover;
use Acme\TweetBundle\Form\Type\TweetSearchType;
use Symfony\Component\HttpFoundation\Request;