Skip to content

Instantly share code, notes, and snippets.

View debuggerpk's full-sized avatar
🖖
whatever you seek is seeking you - Rumi

Yousuf Jawwad debuggerpk

🖖
whatever you seek is seeking you - Rumi
View GitHub Profile
func WithVersionFromBuildInfo() ServiceOption {
return func(s Service) {
if info, ok := debug.ReadBuildInfo(); ok {
var (
revision string
modified string
timestamp time.Time
version string
)
@debuggerpk
debuggerpk / .bashrc
Created September 27, 2015 21:28 — forked from vsouza/.bashrc
Golang 1.4.1 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
echo $AGENT_UUID
@debuggerpk
debuggerpk / models.py
Created January 28, 2012 11:36
models.py
from django.db import models
# Create your models here.
class Leagues(models.Model):
LeagueName = models.CharField(max_length=200)
def __unicode__(self):
return self.LeagueName
class Team(models.Model):
@debuggerpk
debuggerpk / flatten.py
Created September 27, 2018 22:52
Flattens a nested array
def flatten(nested_array, start=[]):
[flatten(x, start) if type(x) == list else start.append(x) for x in nested_array]
return start
# test
given_array = [[1, 2, [3]], 4]
print(flatten(given_array))
@debuggerpk
debuggerpk / README.md
Created May 6, 2018 23:14 — forked from rochapablo/README.md
Gulp Task to transform Typescript path imports into relative paths using the tsconfig

from this

import Head from '~components/Commons/Head';
require('~images/test.jpg')

to this

export const actionToPlainObjectMiddleware = store => next => action => {
if (typeof action === 'object' && action.type) {
const toForward = { ...action };
return next(toForward);
} else if (typeof action === 'function') {
let toForward = action();
toForward = { ...toForward };
return next(toForward);
} else {
throw new Error('Action must be FSA');

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@debuggerpk
debuggerpk / introrx.md
Created September 1, 2017 12:19 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@debuggerpk
debuggerpk / RestService.ts
Created July 13, 2017 01:06
Base Rest Service for angular
import { Headers, RequestOptionsArgs, Response, Request } from '@angular/http';
import { Observable } from 'rxjs/Observable';
interface IRestConfig {
baseHeaders?: Headers;
baseUrl: string;
path?: string;
}
interface IRestQuery {