Skip to content

Instantly share code, notes, and snippets.

View moosebay's full-sized avatar
☪️

Mustafa Bayramoglu moosebay

☪️
View GitHub Profile
@moosebay
moosebay / consoleShim.js
Created July 5, 2020 05:57
This is a shim for console logs. Console log interceptor IE 11 compatiable
var oldConsole = {
log: console.log,
debug: console.debug,
info: console.info,
warn: console.warn,
error: console.error,
trace: console.trace
};
function doSomething(obj) {
version: 2.1
orbs:
preflight: preflight/[email protected]
jobs:
build:
docker:
- image: circleci/node:9.0.0
steps:
- preflight/run-tests:
testId: '1obqIFJ9flGa'
az aks create \
--resource-group YOUR_RESOURCE_GROUP_NAME \
--name AKS \
--load-balancer-sku standard \
--enable-private-cluster \
--network-plugin azure \
--vnet-subnet-id YOUR_SUBNET_ID \
--docker-bridge-address 172.17.0.1/16 \
--dns-service-ip 10.11.0.10 \
--service-cidr 10.11.0.0/24
@moosebay
moosebay / CreateVMFromSnapshot.ps1
Last active May 31, 2020 17:55
Create VM From Snapshot
$conn = Get-AutomationConnection -Name 'AzureRunAsConnection'
Add-AzAccount -ServicePrincipal `
-TenantId $conn.TenantId `
-ApplicationId $conn.ApplicationId `
-CertificateThumbprint $conn.CertificateThumbprint
$sub = '4' #subnet number
$iteration = '10' # instance number
@moosebay
moosebay / DataService.swift
Created May 15, 2017 11:09
GeoFire DataService
let DB_BASE = FIRDatabase.database().reference().child(Salada.Object._version)
class DataService {
static let ds = DataService()
private var _GEO_POST_LOCATION = DB_BASE.child("postLocation")
var GEO_POST_LOCATION: GeoFire {
return GeoFire(firebaseRef: _GEO_POST_LOCATION)
}
@moosebay
moosebay / salada.swift
Created May 15, 2017 11:08
Salada example
let post = Post()
post.userId = currentUser.uid
post.city = place.city
post.location = CLLocation(latitude: place.location.latitude, longitude: place.location.longitude
post.sportType = SportType.soccer
post.venue = venueName
post.zipCode = place.zip
post.placeName = place.placeName
post.save { (ref, error) in
DataService.ds.GEO_SPORTTYPE_LOCATION(sporttype: post.sportType).setLocation(post.location, forKey: ref?.key)
@moosebay
moosebay / fanoutFunction.js
Last active April 23, 2018 17:36
Firebase nodejs admin fanout with Salada objects and GeoFire
var functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
const db = admin.database().ref();
// Salada uses versions to help you structure your
// new design in other version object
const version = 'v1/';