Skip to content

Instantly share code, notes, and snippets.

View narutaro's full-sized avatar
:octocat:
On vacation

narutaro narutaro

:octocat:
On vacation
View GitHub Profile
@btoone
btoone / curl.md
Last active June 29, 2024 16:01
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@idan
idan / gist:3135754
Created July 18, 2012 11:50
A Sample Post

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

If you peek at it with a web inspector, you'll see that it is a second-level heading. You can use first level headings, but they'll look just like the second level ones, and the gods of the HTML5 outlining algorithm will frown upon you.

@tuzz
tuzz / github.css
Last active June 5, 2024 02:29
Github Markdown Stylesheet
/*
Copyright (c) 2017 Chris Patuzzo
https://twitter.com/chrispatuzzo
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:
@willurd
willurd / web-servers.md
Last active June 30, 2024 03:01
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@FromAtom
FromAtom / hatena-blog-api.rb
Last active April 23, 2016 00:04
はてなブログのAPIを使って、記事を投稿するRubyサンプル
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
require 'atomutil'
USERNAME = ARGV[0]
BLOG_DOMAIN = ARGV[1]
PASSWORD = ARGV[2]
POST_URI = "http://blog.hatena.ne.jp/#{USERNAME}/#{BLOG_DOMAIN}/atom/entry"
@pkuczynski
pkuczynski / parse_yaml.sh
Last active June 15, 2024 20:30
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@narutaro
narutaro / Oracle JAVA 7 istallation.md
Last active April 13, 2016 23:32
Oracle JAVA 7 istallation

#Install

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

If you see this error,

$ sudo add-apt-repository ppa:webupd8team/java
sudo: add-apt-repository: command not found
@narutaro
narutaro / docker_registry_setup.md
Last active October 31, 2023 11:43
Docker registry with basic auth and SSL certificate

Docker registry with basic auth and SSL certificate

Docker registry does not have authentication nor certificate mechanism so in case you have docker registry on the internet, you need something that support those in front of the registry. You can find examples using Nginx for it on the web and this is yet another one.

The architecture

Client talks to Nginx. Nginx proxies the request to the docker registry. The nginx is on the host OS - not as a container.

+-----------+     +--------------------------------------------------------+
|           |     |  Server                              Docker container  |
@narutaro
narutaro / Welcome to Gistlog.md
Last active December 27, 2015 22:15
Welcome to Gistlog

#Welcome to Gistlog

##What is Gistlog? Gistlog makes your gist snippets readable like a blog. This page is the live sample of Gistlog. All the contents here come form your gist.

##Intallation This repositry consists of html, css and js so just clone this repogitry to any web server. I recommend to use github pages. Just push to your repositry as <your_name>.github.io

git clone https://github.com/narutaro/narutaro.github.io.git