Skip to content

Instantly share code, notes, and snippets.

@dseg
dseg / get_stock_quotes_nintendo.sh
Created December 7, 2016 09:43
Get Stock Quotes from command-line (shell)
$ curl http://finance.google.com/finance/info?q=TYO:7974
// [
{
"id": "672774"
,"t" : "7974"
,"e" : "TYO"
,"l" : "27,980.00"
,"l_fix" : "27980.00"
,"l_cur" : "�27,980.00"
@dseg
dseg / Generate a 32-bytes base16 string
Created November 2, 2016 12:06
gen-32bytes-base16.sh
#!/bin/sh
dd count=1024 if=/dev/random 2>/dev/null|md5sum|cut -d' ' -f1
@dseg
dseg / gist:995181a123e63cedb7f8629244cdd3e7
Last active October 14, 2016 04:52
How do I find the values to put into my typings.json?

typings/typings#603

typings info dt~PACKAGE_NAME --versions

** But you normally should not edit typings.json manually. ** It's definitely easier to just do

enscript -f Source-Code-Pro8 --line-numbers -p - createPropTypes.js |pstopdf -i -o out.pdf
open out.pdf
@dseg
dseg / index.d.ts
Created September 30, 2016 10:05
The Updated typing file for Redux-Form v5.3.3
// Generated by typings
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/b0f7c3beeda79423c690a0080f984963fa9bec23/redux-form/redux-form.d.ts
declare module 'redux-form' {
import { Component, SyntheticEvent, FormEventHandler } from 'react';
import { Dispatch, ActionCreator, Reducer } from 'redux';
export const actionTypes: {[actionName:string]: string};
export type FieldValue = any;
Lastebil commented on 2010-12-06 14:07
I'm not actually sure what the output difference is, but per the jed build instructions, a make clean should be done before the make. This is mentioned during the build process as well.
Obviously we get an executable that runs afterward, and I haven't had any segfaults or any problems at all, but it's probably a good idea to follow that advice since the jed make scripts are somewhat different.
Anonymous comment on 2013-06-05 06:45
here's build fix because without freetype headers won't be found during build:
--- PKGBUILD~ 2013-06-05 15:43:36.396663854 +0900
@dseg
dseg / nftables.conf
Created April 22, 2016 07:45
A basic nftables config. Only accept ssh, http and https.
#!/usr/bin/nft -f
# ipv4/ipv6 Simple & Safe Firewall
# you can find examples in /usr/share/nftables/
table inet filter {
chain input {
type filter hook input priority 0;
# allow established/related connections
ct state {established, related} accept
@dseg
dseg / sfen-parser.pegjs
Created March 8, 2016 14:33
sfen-parser.pegjs
/**
* Title: SFEN parser
* Date: 23-Jan-2014
* Author: Daichi Shinozaki <dsdseg@gmail.com>
* Demo URL: http://jsfiddle.net/dseg/QezQ7/15/
*
* Note:
* Tested with PEG.js 0.8.0
* http://pegjs.majda.cz/
*
# Maintainer: Daichi Shinozaki <dsdseg@gmail.com>
pkgname=red
pkgver=0.6.0
pkgrel=1
pkgdesc="An open source, native code compiled, dialect of Rebol"
arch=('i686' 'x86_64')
url="http://www.red-lang.org"
license=('custom:3-clause BSD' 'custom:BSL')
groups=('devel')
makedepends=('wget' 'rebol=2.7.8' 'lib32-curl')
#!/bin/bash
VER=1.9.7.3
OPENRESTY=openresty-$VER.tar.gz
OPENSSL_PATH=/usr/local/src/openssl-OpenSSL_1_0_2f
# HTTP/2 patch for Nginx
#curl http://nginx.org/patches/http2/patch.http2-v2_1.9.3.txt -o http2.patch
# OpenResty
if [ ! -f "$OPENRESTY" ]; then