Skip to content

Instantly share code, notes, and snippets.

View wclr's full-sized avatar
🔥
Fighting the SUN

Alex wclr

🔥
Fighting the SUN
  • Need a light, hah?
  • Upper Worlds
View GitHub Profile
@ursi
ursi / publishing-packages.md
Last active April 2, 2021 01:03
The current process for Publishing PureScript packages

PureScript is currently in a transitional period with regards to how new packages are published. As such, the process of publishing a package is rather arduous. You will need: spago, pulp, and bower.

  1. Make sure your package name is unique by searching for it in bower-packages.json and new-packages.json. Alternatively you can search Pursuit as well, but those two files are the sources of truth.
  2. Make sure the module names in your package are globally unique by searching for them on Pursuit. Unfortunately this is a requirement with the current technology. However, finding a module with the same name on Pursuit doesn't mean all hope is lost. Module names only have to be unique in the package set. So you can use the information in step 6 to see if your module name is actually taken. There is a good number of package
@jcalz
jcalz / tuple.md
Last active March 1, 2024 03:33
TypeScript tuple inference

You can use the tuple() function in tuple.ts to infer tuple types in TypeScript and cut down on the need to repeat yourself. Without tuple(), declaring a constant of a tuple type looks like this:

const daysOfTheWeek: ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"] = 
  ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];

You can't do this:

const daysOfTheWeek = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]; 
@ahmetb
ahmetb / gcrgc.sh
Last active February 26, 2024 09:14
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@davisford
davisford / Setup MongoDB on localhost as Replica Set
Last active March 6, 2024 21:40
Setup MongoDB replica set on local host with only a single primary
Add the `replication` section to the mongod.conf file:
```
$cat /usr/local/etc/mongod.conf
systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
storage:
engine: mmapv1
@A-gambit
A-gambit / REACTIVE2016-LIGHTNING-PROPOSAL.md
Last active February 22, 2024 18:24
Proposal for lightning talk at ReactiveConf 2016: Road from UndefinedLand

Proposal for a lightning talk at the Reactive 2016.

Keep calm and like/retweet it on Twitter and star this Gist to vote on this talk.

Road from UndefinedLand

Undefiend

I work at Grammarly. We like React and happily use it in our applications. However, sometimes something goes wrong and bugs creep into the code. Here comes testing. It helps make us confident about the quality of our code.

@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active February 24, 2024 04:41
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@marshallswain
marshallswain / live-binding-opt-out.js
Created July 5, 2015 21:36
Live Binding Opt Out Helper
// Opt out of live binding by not using the property's compute.
// Usage: {{~ 'propName'}}
can.stache.registerHelper('~', function(prop, options) {
return options.context[prop];
});
@justinbmeyer
justinbmeyer / tabs.stache
Created February 1, 2015 18:36
tabs.stache
<can-component tag='can-tabs'>
<style type='less'>
margin-top: 20px;
button {clear: both;}
ul {
padding: 0px; margin: 0px;
}
ul:after { content: "."; display: block; height: 1px; clear: both; visibility: hidden; }
ul { display: inline-block; }
li {
@donnut
donnut / currying.md
Last active October 28, 2023 17:58
TypeScript and currying

TypeScript and currying

In functional programming you often want to apply a function partly. A simple example is a function add. It would be nice if we could use add like:

var res2 = add(1, 3); // => 4

var add10To = add(10);
var res = add10To(5); // => 15
@nolanlawson
nolanlawson / offline-first-tools.md
Last active March 16, 2024 15:46
List of offline-first tools for web developers

Offline-first tools for web developers

A quick list of tools for building HTML/CSS/JS apps that work well offline. Ping me at @nolanlawson if I missed anything!

Hybrid app development

Tools for bundling your HTML/CSS/JS into a native app.