Skip to content

Instantly share code, notes, and snippets.

View octagonal's full-sized avatar

Anthony Madhvani octagonal

View GitHub Profile
@octagonal
octagonal / heroku_env.sh
Last active June 11, 2018 10:55
Some simple oneliners that make working with Heroku easier
# A collection of snippets for managing Heroku env vars
# It ain't pretty but it works
# Copy Heroku config to a local .env file
heroku config --app $HEROKU_APP | sed 's/: */=/' | tail -n +2 | tee $ENV_FILE
# Set a Heroku app's config from a local env file
# I got this oneliner from a blog somewhere, can't find it again
heroku config:set --app $HEROKU_APP $(cat .env | sed '/^$/d; /#[[:print:]]*$/d')
# Set a Heroku app's config from another Heroku app's config
var express = require('express');
var session = require('express-session');
var RedisStore = require('connect-redis')(session);
var Strategy = require('./passport-openidconnect/index').Strategy;
module.exports.configure = function configure(app, passport) {
var identityServer = 'https://users.xxx.com/identity';
var auth = {
@hoetmaaiers
hoetmaaiers / overview.md
Last active August 29, 2022 07:28
Webstorm live templates

React Native Live Templates for WebStorm

How to add Live Template in Webstorm

  1. open preferences
  2. editor> live templates
  3. add template group for React Native
  4. add templates below to the new group
  5. define context > javascript
  6. edit variables > add "fileNameWithoutExtension" to "$fnName$"
@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();