This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert' as convert; | |
import 'dart:io' as io; | |
Future<void> main() async { | |
final apiKey = io.Platform.environment['QUIET_INTERNET_API_KEY']!; | |
final client = QuietInternetClient(apiKey: apiKey); | |
final posts = await client.getPosts(perPage: 1, visibility: 'ANYONE'); | |
for (final post in posts) { | |
final postDetail = await client.getPost(post.slug); | |
print([ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'time' | |
# http://doc.ruby-lang.org/ja/2.0.0/method/Time/i/iso8601.html | |
t = Time.now | |
p t # 2013-05-14 18:42:37 +0900 | |
p t.iso8601 # "2013-05-14T18:42:37+09:00" | |
p t.iso8601(3) # "2013-05-14T18:42:37.192+09:00" | |
p t.iso8601(6) # "2013-05-14T18:42:37.192681+09:00" | |
p t.iso8601(10) # "2013-05-14T18:42:37.1926810000+09:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
get '/' do | |
<<-EOS | |
<html> | |
<head> | |
<script src="nosniff.js" /></script> | |
<link rel="stylesheet" href="nosniff.css" /> | |
</head> | |
<body>nosniff test</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'cgi' | |
require 'json' | |
require 'open-uri' | |
require 'pathname' | |
def get url | |
p ['get', url] | |
r = OpenURI.open_uri(url).read |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name sumally-add-via-link | |
// @namespace swdyh | |
// @include http://sumally.com/* | |
// @version 0.0.1 | |
// ==/UserScript== | |
document.addEventListener('DOMNodeInserted', function(ev) { | |
if (ev.target && ev.target.className == 'oneblock') { | |
addVia(ev.target) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'digest/md5' | |
require 'optparse' | |
require 'stringio' | |
module S3Etag | |
def calc opt = {} | |
threshold = opt[:threshold] || 16 * 1024 * 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef mad | |
_arguments \ | |
'(-U --update-self)'{-U,--update-self}'[update mad(1) itself]' \ | |
'(-u --update)'{-u,--update}'[update remote mad-pages]' \ | |
'(-v --version)'{-v,--version}'[output mad version]' \ | |
'(-h --help)'{-h,--help}'[output this help information]' \ | |
'(-l --list)'{-l,--list}'[list mad-pages]' \ | |
'-[read from stdin]' \ | |
'*:: :->' && return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require('util') | |
var events = require('events') | |
var express = require('express') | |
var redis = require('redis') | |
var app = express.createServer() | |
var notifyEmitter = new events.EventEmitter() | |
var redisClientSubscriber = redis.createClient() | |
redisClientSubscriber.on('message', function(ch, d) { | |
util.log(JSON.stringify(['redisSubscriber', ch, d])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String file contents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test test |
NewerOlder