Skip to content

Instantly share code, notes, and snippets.

View petrbela's full-sized avatar

Petr Bela petrbela

View GitHub Profile
@petrbela
petrbela / poll_production.json
Last active August 20, 2018 23:22
Medium: Apple Subscriptions? WAT?!
{
"status": 0,
"environment": "Production",
"receipt": {
"latest_receipt_info": [],
"latest_receipt": "...",
"pending_renewal_info": [
{
"auto_renew_product_id": "com.sweatflex.flex.monthly",
"original_transaction_id": "...",
@petrbela
petrbela / Fastfile
Last active December 1, 2022 01:30
React Native deployment
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
@petrbela
petrbela / Install.md
Last active June 13, 2017 20:04
Install TF + CUDA on Mac

Notes from installing CUDA and TensorFlow on a MacBook Pro 15" 2013 with GeForce 650M

  1. Download CUDA and run installer (see notes)
  2. Go to System Preferences > CUDA and update driver version if prompted.
  3. Make sure deviceQuery lists your GPU
  4. Add cuda to syspath
    export PATH=$PATH:/usr/local/cuda/bin
  5. Download CuDNN (TF on pip currently compiled for version 5.x), unpack and move to /usr/local/cuda
@petrbela
petrbela / cloudSettings
Last active June 13, 2019 17:15
Visual Studio Code Sync Settings GIST
{"lastUpload":"2019-06-13T17:15:30.511Z","extensionVersion":"v3.2.9"}
@petrbela
petrbela / 0_reuse_code.js
Created October 22, 2016 08:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@petrbela
petrbela / Album.js
Last active March 26, 2017 19:12
GraphQL types in separate files
'use strict'
import {
GraphQLObjectType,
GraphQLString,
} from 'graphql'
import Types from './Types'
Types.Album = new GraphQLObjectType({
@petrbela
petrbela / rolling-restart.sh
Created May 12, 2015 19:35
Elasticsearch rolling restart
# Copied from https://github.com/logsearch/logsearch-boshrelease/blob/develop/share/util/elasticsearch-rolling-restart
#!/bin/bash
#
# perform a rolling restart of all data/master nodes in a stable cluster
#
# args: [-i|--interactive] [elasticsearch-host:port]
#
@petrbela
petrbela / keybase.md
Last active August 29, 2015 14:05
Keybase proof

Keybase proof

I hereby claim:

  • I am petrbela on github.
  • I am petrbela (https://keybase.io/petrbela) on keybase.
  • I have a public key whose fingerprint is C6BB 7046 2330 28DE C757 02CA 4A28 5F03 51EA 3821

To claim this, I am signing this object:

<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@petrbela
petrbela / Geo_distance.lua
Last active August 29, 2015 14:02
ApiTools SFPark geo distance middleware
return function(request, next_middleware)
local function geo_distance(lat1, lon1, lat2, lon2)
if lat1 == nil or lon1 == nil or lat2 == nil or lon2 == nil then
return nil
end
local dlat = math.rad(lat2-lat1)
local dlon = math.rad(lon2-lon1)
local sin_dlat = math.sin(dlat/2)
local sin_dlon = math.sin(dlon/2)
local a = sin_dlat * sin_dlat + math.cos(math.rad(lat1)) * math.cos(math.rad(lat2)) * sin_dlon * sin_dlon