Skip to content

Instantly share code, notes, and snippets.

@shinaisan
shinaisan / index.css
Last active January 24, 2024 14:42
Example of webpack with showdown
body {
margin-top: 10px;
}
@shinaisan
shinaisan / nanosleep.c
Created November 10, 2012 06:39
A short sample C program using nanosleep and getrusage.
/* -*- mode: c; indent-tabs-mode: nil; c-basic-offset: 4; coding: utf-8-unix -*- */
#include <stdio.h>
#include <time.h>
#include <stdint.h>
#include <sys/time.h>
#include <sys/resource.h>
int main(int argc, char *argv[]) {
struct timespec ts;
struct rusage ru;
@shinaisan
shinaisan / README.md
Created March 27, 2016 11:05
A quick-and-dirty sample of Slim and Pure.css

A quick-and-dirty sample of Slim and Pure.css

Usage

gem install slim
ruby conv.rb > test.html

Open test.html in a browser to see how it looks.

@shinaisan
shinaisan / App.js
Last active January 16, 2023 16:22
Redux Form - Material UI Example
import React from 'react';
import MaterialUiForm from './MaterialUiForm';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import reducer from './reducer';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
const store = createStore(reducer);
@shinaisan
shinaisan / stackoverflow.c
Created November 10, 2012 08:21
setrlimit and segmentation fault (11) sample
/* -*- mode: c; indent-tabs-mode: nil; c-basic-offset: 4; coding: utf-8-unix -*- */
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <sys/resource.h>
void print_rlimit(struct rlimit *r, const char *name) {
int64_t cur; /* Soft limit */
int64_t max; /* Hard limit */
cur = r->rlim_cur;
@shinaisan
shinaisan / README.md
Last active June 19, 2022 14:27
Short Example of Logstash Multiple Pipelines

Short Example of Logstash Multiple Pipelines

This gist is just a personal practice record of Logstash Multiple Pipelines.

The following summary assumes that the PATH contains Logstash and Filebeat executables and they run locally on localhost.

Logstash config

@shinaisan
shinaisan / reveal-init.js
Created January 2, 2013 04:24
A minimal example slideshow of reveal.js plus highlight.js written partially in Markdown/Showdown
Reveal.initialize({
// Display controls in the bottom right corner
controls: true,
// Display a presentation progress bar
progress: true,
// If true; each slide will be pushed to the browser history
history: true,
// Loops the presentation, defaults to false
loop: false,
// Flags if mouse wheel navigation should be enabled
@shinaisan
shinaisan / canvas.html
Created August 6, 2013 10:20
A dead simple HTML5 canvas drawing example with a drawing tool selection based on Twitter Bootstrap.
<html>
<head>
<link rel="stylesheet" href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css"></link>
<!-- jquery.js must be loaded before bootstrap.js. -->
<script type="text/javascript" src="http://getbootstrap.com/2.3.2/assets/js/jquery.js"></script>
<script type="text/javascript" src="http://getbootstrap.com/2.3.2/assets/js/bootstrap.js"></script>
<script type="text/javascript" src="paint.js"></script>
<style type="text/css">
body {
@shinaisan
shinaisan / index.js
Last active July 24, 2021 18:32
Webpack and D3 (d3.drag) Example
import * as d3 from 'd3';
var config = {
width: 640,
height: 640,
plot: {
width: 560,
height: 560,
}
};
@shinaisan
shinaisan / reveal-init.js
Created January 1, 2013 14:08
A minimal example slide of reveal.js plus highlight.js
Reveal.initialize({
// Display controls in the bottom right corner
controls: true,
// Display a presentation progress bar
progress: true,
// If true; each slide will be pushed to the browser history
history: true,
// Loops the presentation, defaults to false
loop: false,
// Flags if mouse wheel navigation should be enabled