Skip to content

Instantly share code, notes, and snippets.

View letsspeak's full-sized avatar
๐Ÿฅฐ

Masatsugu Omiya letsspeak

๐Ÿฅฐ
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<main></main>
<script crossorigin src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
@lattner
lattner / async_swift_proposal.md
Last active December 28, 2024 11:11 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

@joar
joar / jq-insert-var.sh
Last active March 8, 2025 21:45
Add a field to an object with JQ
# Add field
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}'
# {
# "hello": "world",
# "foo": "bar"
# }
# Override field value
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}'
{
@tkh44
tkh44 / FileController.js
Last active March 10, 2020 09:04
Simple file upload for sails.js
module.exports = {
get: function (req, res) {
res.sendfile(req.path.substr(1));
},
_config: {
rest: false,
shortcuts: false
}
};
@k0f1sh
k0f1sh / naruto.el
Last active December 20, 2015 03:38
(require 'dash)
(defconst PI 3.1415)
(defconst a 0.05)
(defvar scale-x 0.3
"x่ปธๆ‹กๅคง็އ")
(defvar scale-y 0.3
"y่ปธๆ‹กๅคง็އ")
@mtmtcode
mtmtcode / helm-redmine.el
Last active December 17, 2015 19:49
;;;; helm-redmine.el --- show redmine tickets with helm interface
;;;; helm-redmine.el --- show redmine tickets with helm interface
;; Copyright (C) 2013 by l3msh0
;; Author: l3msh0
;; URL: https://gist.github.com/l3msh0/5663231
;; Version: 0.0.1
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@Gab-km
Gab-km / whyILeftHeroku.rst
Last active December 30, 2022 10:56
ไฝ•ๆ•…็งใฏ Heroku ใ‹ใ‚‰้›ขใ‚ŒใŸใ‹ใ€ใŠใ‚ˆใณๆ–ฐใ—ใ„ AWS ใ‚ปใƒƒใƒˆใ‚ขใƒƒใƒ—ใฎใƒกใƒข

ไฝ•ๆ•…็งใฏ Heroku ใ‹ใ‚‰้›ขใ‚ŒใŸใ‹ใ€ใŠใ‚ˆใณๆ–ฐใ—ใ„ AWS ใ‚ปใƒƒใƒˆใ‚ขใƒƒใƒ—ใฎใƒกใƒข

ๅŽŸ่‘—่€…:Adrian Holovaty
ๅŽŸๆ–‡:Why I left Heroku, and notes on my new AWS setup

้‡‘ๆ›œๆ—ฅใ€็งใฏ Heroku ใ‹ใ‚‰ Amazon Web Services(AWS) ใ‚’็›ดๆŽฅไฝฟใ†ใ‚ˆใ†ใซ Soundslice ใ‚’็งป่กŒใ—ใพใ—ใŸใ€‚็งใฏใ“ใฎๅค‰ๆ›ดใŒใงใใฆใจใฆใ‚‚ใ€ใใ†ใจใฆใ‚‚ๅฌ‰ใ—ใใฆใ€็งใŒใฉใ†ใ‚„ใฃใŸใ‹ใจใ„ใ†ใ“ใจใจใ€ใ‚‚ใ—็š†ใ•ใ‚“ใŒๅŒใ˜ใ‚ˆใ†ใช็ซ‹ๅ ดใ ใฃใŸใ‚‰ไฝ•ๆ•…ใใ‚Œใ‚’ๆคœ่จŽใ™ในใใ‹ใจใ„ใ†ใ“ใจใซใคใ„ใฆๅบƒใไผใˆใŸใ„ใจๆ€ใ„ใพใ™ใ€‚

@letsspeak
letsspeak / sync-charag
Created July 30, 2012 00:35
immediately rsync when the file in specific directory was written by vim (final edition)
#!/bin/sh
rsync -av -e "ssh -p XXXX" $1 [email protected]:$2