Skip to content

Instantly share code, notes, and snippets.

jimmycliff obonyo obonyojimmy

  • Kenya
Block or report user

Report or block obonyojimmy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View better-nodejs-require-paths.md

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@obonyojimmy
obonyojimmy / in.ts
Created Aug 29, 2016 — forked from indus/in.ts
Typescript Pattern for Vue Components
View in.ts
module MyModule {
export class MyClass extends Vue {
// define instance methods
myMethod() {
// the TS-Type of "this" is defined as Instance of MyClass
console.log("myMethod");
}
myOtherMethod() {
console.log("myOtherMethod");
@obonyojimmy
obonyojimmy / AuthenticateController.php
Created Oct 22, 2016 — forked from iolson/AuthenticateController.php
SentinelAuthAdapter for using Tymon\JWTAuth with Cartalyst\Sentinel
View AuthenticateController.php
<?php namespace App\Http\Controllers\Api\V1;
use App\Http\Controllers\Controller;
use App\Http\Requests;
use Illuminate\Http\Request;
use Tymon\JWTAuth\Facades\JWTAuth;
use Tymon\JWTAuth\Exceptions\JWTException;
class AuthenticateController extends Controller
{
View golang-create-read-write-delete-file.go
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@obonyojimmy
obonyojimmy / check-window-type.go
Created Jan 1, 2017
Go lang check if active window the window yo are looking for
View check-window-type.go
package main
import (
"fmt"
"syscall"
"unsafe"
"golang.org/x/sys/windows"
)
var (
View idleMonitor.go
package main
import (
"fmt"
"syscall"
"time"
"unsafe"
)
func main() {
@obonyojimmy
obonyojimmy / win32.go
Created Jan 2, 2017 — forked from nathan-osman/win32.go
Simple Windows GUI application written in Go
View win32.go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
@obonyojimmy
obonyojimmy / async-keylogger.go
Created Jan 2, 2017
simple windows keylogger using GetAsyncKeyState
View async-keylogger.go
package main
import (
"fmt"
"io"
"log"
"io/ioutil"
"time"
"golang.org/x/sys/windows"
)
@obonyojimmy
obonyojimmy / sclg4.c
Created Jan 3, 2017 — forked from aktau/sclg4.c
A simple WinAPI GetAsyncKeyState()-based keylogger, written a very long time ago. I dug it out of the archives because of a Hacker News post (https://news.ycombinator.com/item?id=7607082). For educational purposes only, of course.
View sclg4.c
/**
* Copyright (c) 2006, Nicolas Hillegeer
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
View Git-remote-repo.md

First, you create your branch locally:

git checkout -b

The remote branch is automatically created when you push it to the remote server. So when you feel ready for it, you can just do:

git push

Where is typically origin, the name which git gives to the remote you cloned from. Your colleagues would then just pull that branch, and it's automatically created locally.

You can’t perform that action at this time.