Skip to content

Instantly share code, notes, and snippets.

@jonniedarko
jonniedarko / firebase.json
Created November 4, 2023 15:15 — forked from katowulf/firebase.json
Example of Firebase emulator unit tests and seed Firestore data
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"emulators": {
"firestore": {
"port": 8080
}
}
@jonniedarko
jonniedarko / github-stylebot.css
Created June 7, 2019 14:44
My github Stylebot css
// fill width with code/ file
div.container-lg {
width: calc(100% - 20px);
max-width: calc(100% - 20px);
}
@jonniedarko
jonniedarko / uefisetup.sh
Created November 6, 2017 13:47 — forked from Apsu/uefisetup.sh
Arch Linux UEFI Setup
# **************** READ THIS FIRST ******************
#
# This is not a script for you to run. I repeat, do not download and run this!
#
# This is only a guide to show the required steps for successful UEFI + GRUB2 installation
# Many of the choices are examples or assumptions; don't blindly type shit into your machine
# until/unless you at least read the comments around each command
#
# These steps assume you've booted in UEFI mode by preparing your USB stick per these instructions:
# https://wiki.archlinux.org/index.php/UEFI#Archiso
@jonniedarko
jonniedarko / Rubyhello.rb
Created March 21, 2017 15:50
Ruby Hello world
puts "hello World"
@jonniedarko
jonniedarko / one-liners.sh
Created December 11, 2016 17:53
Usefull Terminal one liners
# allows more powerful pattern matching e.g. `mv !(some_folder) some_folder` to disable use `-u` option instead
shopt -s extglob

Let's say you make a filter that can replace things with regular expressions:

myApp.filter("regexReplace", function() { // register new filter

  return function(input, searchRegex, replaceRegex) { // filter arguments

    return input.replace(RegExp(searchRegex), replaceRegex); // implementation

  };
});
@jonniedarko
jonniedarko / Material.module.ts
Created October 6, 2016 14:00
Angular2-material Module wrapper
import { NgModule } from '@angular/core';
// Material
import { MdCardModule } from '@angular2-material/card';
import { MdButtonModule } from '@angular2-material/button';
import { MdInputModule } from '@angular2-material/input';
import { MdToolbarModule } from '@angular2-material/toolbar';
import { MdListModule } from '@angular2-material/list';
import { MdIconModule, MdIconRegistry } from '@angular2-material/icon';
@jonniedarko
jonniedarko / jio_cloudwatch_utilities.sh
Last active July 5, 2018 20:25
AWS Cloud watch utiliy script
#!/bin/bash
#
# functions to help with cloudwatch set up
# based on https://github.com/swoodford/aws
#
# Trying to mostly conform to Google's style guide:
# https://google.github.io/styleguide/shell.xml
#################################################
# CONSTANTS & DEFAULTS
@jonniedarko
jonniedarko / WebstormTweak
Created August 10, 2016 15:18 — forked from abhisheksliam/WebstormTweak
Speed up WebStorm
Here is my recipe how to speed up WebStorm:
Go to Preferences and do next:
Appearance & Behaviour > System Settings > Updates: disable auto update
Appearance & Behaviour > System Settings > Using Statistics: Uncheck allowing sending data
Editor > Live Templates: disable all, leave only what you are really use
Editor > Emmet: disable all emmets
Editor > Intentions: I leave only: CSS, Declaration, JavaScript and Language Injection
Plugins: leave only next (* - can be also disabled in case don't need them):
CoffeeScript *
@jonniedarko
jonniedarko / fit-map.js
Created June 2, 2016 13:07
Make google maps fit a radius and pos - based on http://www.movable-type.co.uk/scripts/latlong.html
function toRad(num) {
return num * Math.PI / 180;
},
function toDeg(num) {
return num * 180 / Math.PI;
},
function destinationPoint(LatLng, bearingDegrees, radiusMeters) {
dist = radiusMeters / 1000 // convert to KM