Skip to content

Instantly share code, notes, and snippets.

@menuka94
menuka94 / .travis.yml
Created October 13, 2017 08:33 — forked from ryboe/.travis.yml
Example .travis.yml for Golang
language: go
# Only the last two Go releases are supported by the Go team with security
# updates. Any versions older than that should be considered deprecated.
# Don't bother testing with them. tip builds your code with the latest
# development version of Go. This can warn you that your code will break
# in the next version of Go. Don't worry! Later we declare that test runs
# are allowed to fail on Go tip.
go:
- 1.7
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@menuka94
menuka94 / goth
Created August 31, 2017 09:31 — forked from ammario/goth
golang test coverage html
#!/bin/bash
go test -coverprofile=coverage.out
go tool cover -html=coverage.out
@menuka94
menuka94 / main.go
Created August 1, 2017 04:58 — forked from manishtpatel/main.go
GoLang Encrypt string to base64 and vice versa using AES encryption.
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
)
import {Injectable} from '@angular/core';
import {FirebaseAuth, AngularFire} from "angularfire2";
import {Subject, Observable, BehaviorSubject} from "rxjs";
import {AuthInfo} from "./auth-info";
@Injectable()
export class AuthService {
static UNKNOWN_USER = new AuthInfo(null);
authInfo$: BehaviorSubject<AuthInfo> = new BehaviorSubject<AuthInfo>(AuthService.UNKNOWN_USER);
@menuka94
menuka94 / fix-nautilus.sh
Last active August 18, 2018 18:01 — forked from jiromm/gist:ce628934a90433c56252
Linux Commands
# Find the process IDs
ps awx | grep nautilus
# Then kill it
sudo kill -TERM <id>
@menuka94
menuka94 / data-structure.js
Created February 14, 2017 16:47 — forked from sararob/data-structure.js
Role-based security in Firebase
/*
This example shows how you can use your data structure as a basis for
your Firebase security rules to implement role-based security. We store
each user by their Twitter uid, and use the following simplistic approach
for user roles:
0 - GUEST
10 - USER
20 - MODERATOR
@menuka94
menuka94 / index.html
Created February 10, 2017 06:40 — forked from puf/index.html
Zero to App: Develop with Firebase (for Web - Google I/O 2016)
<html>
<head>
<script src="https://www.gstatic.com/firebasejs/3.0.0/firebase.js"></script>
<title>ZeroToApp</title>
<style>
#messages { width: 40em; border: 1px solid grey; min-height: 20em; }
#messages img { max-width: 240px; max-height: 160px; display: block; }
#header { position: fixed; top: 0; background-color: white; }
.push { margin-bottom: 2em; }
@keyframes yellow-fade { 0% {background: #f2f2b8;} 100% {background: none;} }
@menuka94
menuka94 / ChatMessage.java
Last active February 10, 2017 06:39 — forked from puf/ChatMessage.java
Zero to App: Develop with Firebase (for Android - Google I/O 2016)
package com.google.firebase.zerotoapp;
public class ChatMessage {
public String name;
public String message;
public ChatMessage() {
}
public ChatMessage(String name, String message) {