Skip to content

Instantly share code, notes, and snippets.

🤡
-

Steve Wagner lanwin

🤡
-
View GitHub Profile
@lanwin
lanwin / graphql-tag-source.ts
Created Mar 23, 2020
This is a simplified version of graphql-tag whish only outputs the source of each graphql query instead of a documentNode.
View graphql-tag-source.ts
// Copyright 2020 Steve Wagner
// 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:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE US
View react-copy-write-typings.ts
declare module "react-copy-write" {
interface ConsumerProps<TState> {
select?: any;
children: (store: TState) => any;
}
interface ISelector<TState, TRet> {
select: (store: TState) => TRet;
}
View keybase.md

Keybase proof

I hereby claim:

  • I am lanwin on github.
  • I am lanwin (https://keybase.io/lanwin) on keybase.
  • I have a public key whose fingerprint is 1B62 8305 FF00 2CB8 6832 1498 B14D EC8D 81B8 000B

To claim this, I am signing this object:

@lanwin
lanwin / index.html
Created Jun 7, 2016
Redux devtools extension with mori
View index.html
<!DOCTYPE html>
<html>
<body>
<script src="/node_modules/redux/dist/redux.js" type="text/javascript"></script>
<script src="/node_modules/mori/mori.js" type="text/javascript"></script>
<script type="text/javascript">
"use strict";
function reducer(){
return mori.hashMap('key','value');
@lanwin
lanwin / quote.txt
Last active Dec 25, 2015
Less types and more functions.
View quote.txt
As lisp programmers have know for a long time it is better to have a smallish number of ubiquitous data types and a large number of small functions that work on them, than to have a large number of data types and a small number of functions that work on them.
@lanwin
lanwin / object_stream_merging.js
Created Aug 6, 2013
Nodejs merging object streams. Here is my current working example. But I dont like it. A MergeStream with one 'end' event would be much better. A sidenode: FeedParser implements node TransformStream and set its objectmode to true so that in the end we stream objects instead buffers. This could be better solved with RxJS. But what I currently don…
View object_stream_merging.js
var data = [];
exampleFeeds.forEach(function(feedFile) {
fs.createReadStream(feedFile)
.pipe(new FeedParser())
.on('meta', function(meta) {
data.push(meta);
if(data.length===exampleFeeds.length){
console.log('done '+data.length);
// do something
}
@lanwin
lanwin / gist:4138801
Created Nov 24, 2012
Immutable type checking for Simon
View gist:4138801
class Mutable {
}
[Immutable]
public class ImmutableB
{
public readonly A = new ImmutableA();
}
@lanwin
lanwin / gist:4124736
Created Nov 21, 2012
constructor function - but R# Name dose not match rule 'Local Variable'. Suggested name is app.
View gist:4124736
(function() {
"use strict";
// constructor function - but R# Name dose not match rule 'Local Variable'. Suggested name is app.
var App = function() {
// ...
};
ko.applyBindings(new App());
})();
@lanwin
lanwin / oom.cs
Created Oct 28, 2012
Raven Client 1.2.2127 OOM on inserting large amounts of data
View oom.cs
public class OutOfMemoryTest
{
public void Run()
{
// client version 1.2.2127
using(var store = new DocumentStore
{
Url = "http://TestRaven:8080",
DefaultDatabase = "Test",
})
@lanwin
lanwin / kudu_with_subdomain.patch
Created Aug 9, 2012
This patch extens Kudu to use the given app subdomains instead random ports with localhost for site bindings.
View kudu_with_subdomain.patch
Kudu.SiteManagement/SiteManager.cs | 31 ++++++++++++++++++-------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/Kudu.SiteManagement/SiteManager.cs b/Kudu.SiteManagement/SiteManager.cs
index 43a6012..87b466d 100644
--- a/Kudu.SiteManagement/SiteManager.cs
+++ b/Kudu.SiteManagement/SiteManager.cs
@@ -6,12 +6,15 @@
using System.Net.NetworkInformation;
using System.Threading;
You can’t perform that action at this time.