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
const { google } = require("googleapis"); | |
const fs = require("fs"); | |
// You need to go to Google Cloud console (console.cloud.google.com), then APIs | |
// & Services -> Credentials. There, create a new service account (or reuse | |
// existing if you have one). Click on a service account, go to Keys, and create | |
// a new key, and download JSON for it. You'll use path to that JSON for | |
// SERVICE_ACCOUNT_FILE var. | |
// | |
// Then, go to Google Play Console, then "Users and Permissions" on the left |
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
const fetch = require("node-fetch"); | |
const fs = require("fs"); | |
const jwt = require("jsonwebtoken"); | |
const util = require("util"); | |
// To get the private key, go to App Store Connect (appstoreconnect.apple.com), then "Users and Access" | |
// at the top. Then go to "Integrations" -> "App Store Connect API", under "Team Keys" create a new key, | |
// and you'll be able to download the private key for it. | |
const PRIVATE_KEY = fs.readFileSync("AuthKey_F2BLAHBLAH.p8", "utf8"); |
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
apiVersion: apps/v1beta1 | |
kind: Deployment | |
metadata: | |
name: app-deployment | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: app |
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
Logger get logger => Zone.current[#logger]; | |
Logger _initializeRequestLogger() { | |
var uid = new Random().nextInt(1000); | |
var logger = new Logger.detached("app:${uid}"); | |
logger.onRecord.listen(print); | |
return logger; | |
} | |
@app.Route("/foo") |
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
// It seems like it takes ~60-100ms to create an isolate and 20-30ms to send messages over a | |
// cold port on my Macbook Pro. Once ports are warmed up, it works way faster, especially sending | |
// from the isolate to the main process - 0-1ms. By some reason, sending a message from the main | |
// process to isolate fluctuates way more - 0-10ms. | |
import 'dart:isolate'; | |
import 'dart:async'; | |
import 'package:isols/src/logging.dart'; | |
import 'package:logging/logging.dart'; |
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
library maybe; | |
abstract class Maybe<T> { | |
T get value; | |
bool get isEmpty; | |
} | |
class Nothing extends Maybe { | |
get value => null; | |
bool get isEmpty => true; |
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
$solver_timestamp_sec: 0.01; | |
// Rebound.js-like spring animations in SCSS. | |
// There is a bunch of functions, which helps generating keyframes for you spring | |
// animations, if you (like me) really want to avoid doing that in JavaScript. | |
// | |
// It only generates values for one spring, with given friction, tension and end value | |
// (i.e. it doesn't support spring systems) | |
// Friction and tension are matched to the values used in Origami, so you can use whatever | |
// your designers put in a Quartz Composer file in "Bouncy Animation" blocks :) |
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 'forwardable' | |
require 'pp' | |
# * Schema may be only an array | |
# * It may not contain an array, only a symbol or a hash | |
# * The key of a hash is always a symbol and the value is always an array or array inside an array | |
# * To show that it should iterate through a collection on input, we use array in array | |
class Schema | |
include Enumerable | |
extend Forwardable |
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
==== General Organizational Principles for CSS and JS in Rails | |
=== Framework requirements | |
1. Modularity | |
2. Complex components are built from simple, atomic components | |
3. Cross-browser compatibility | |
a. Follow W3C standards | |
b. Keep IE hacks in a separate style file | |
4. Bulletproof |
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
scope :paginate, lambda { |page, per_page| limit(per_page.to_i).offset((page.to_i - 1) * per_page.to_i) } |
NewerOlder