Skip to content

Instantly share code, notes, and snippets.

View iwatakeshi's full-sized avatar
📚
Always learning

Takeshi iwatakeshi

📚
Always learning
View GitHub Profile
@iwatakeshi
iwatakeshi / custom_iterator.cpp
Created February 19, 2019 00:56 — forked from jeetsukumaran/custom_iterator.cpp
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>
//
// Copyright (c) 2014 Sean Farrell
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
{"contents":{"launch":{"version":"0.2.0","configurations":[{"name":"Extension","type":"extensionHost","request":"launch","runtimeExecutable":"${execPath}","args":["--extensionDevelopmentPath=${workspaceFolder}"]}]}},"overrides":[],"keys":["launch.version","launch.configurations"]}
@iwatakeshi
iwatakeshi / pipelines.yml
Last active April 23, 2019 13:38 — forked from nicobytes/pipelines.yml
Install chrome for CI
image: node:6.9.4
pipelines:
branches:
master:
- step:
script:
- apt-get update; apt-get install -y gettext-base;
- echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- set -x && apt-get update && apt-get install -y xvfb google-chrome-stable
@iwatakeshi
iwatakeshi / Contract Killer 3.md
Created July 11, 2019 21:12
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@iwatakeshi
iwatakeshi / A Nuxt.js VPS production deployment.md
Created August 14, 2019 02:34 — forked from DreaMinder/A Nuxt.js VPS production deployment.md
Deployment manual for a real-world project built with nuxt.js + koa + nginx + pm2

Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin-panel SPA, nuxt.js renderer and JSON API.

This manual is relevant for VPS such as DigitalOcean.com or Vultr.com. It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger than a landing page.

UPD: This manual now compatible with [email protected]. For older versions deployment, see revision history.


Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:

@iwatakeshi
iwatakeshi / nuxt.config.js
Created August 19, 2019 15:37 — forked from mkmms/nuxt.config.js
@nuxt/apollo Cors Issue Apollo config
apollo: {
clientConfigs: {
default: {
httpEndpoint: `${process.env.API_URL}/graphql`,
httpLinkOptions: {
fetchOptions: {
mode: 'cors' //Cors Needed for external Cross origins, need to allow headers from server
},
credentials: "omit" //must be omit to support application/json content type
}
@iwatakeshi
iwatakeshi / responsive-badge.html
Created August 25, 2019 21:37 — forked from ericclemmons/responsive-badge.html
Responsive indicators for TailwindCSS
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/tailwind.min.css">
<!-- Responsive indicators! -->
<div class="fixed top-0 right-0 z-50 bg-pink-500 text-white shadow-md px-2 rounded-bl font-mono">
<span class="sm:hidden">default</span>
<span class="hidden sm:inline md:hidden">sm</span>
<span class="hidden md:inline lg:hidden">md</span>
<span class="hidden lg:inline xl:hidden">lg</span>
<span class="hidden xl:inline">xl</span>
</div>
@iwatakeshi
iwatakeshi / nginx.conf
Created September 12, 2019 05:59 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@iwatakeshi
iwatakeshi / nginx.conf
Created September 20, 2019 05:33 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which