Skip to content

Instantly share code, notes, and snippets.

@nonlogos
nonlogos / hello_world.py
Last active April 5, 2019 17:07
Hello World Examples
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
[observe]
writing RSA key
rm server.pass.key
openssl req -new -key server.key -out server.csr
@nonlogos
nonlogos / git_command.txt
Created December 4, 2018 17:21
git reset master branch to latest
git fetch --all
git reset --hard origin/master

Keybase proof

I hereby claim:

  • I am nonlogos on github.
  • I am nonlogos1 (https://keybase.io/nonlogos1) on keybase.
  • I have a public key ASBjxAjihFGVwG8TfEbOTE5Imilz0trmnnb6-Z5mWNzc3wo

To claim this, I am signing this object:

@nonlogos
nonlogos / redis.md
Last active October 30, 2018 10:57
Redis installation
  1. brew install redis
  2. use brew services start redis to run redis
  3. use brew services restart redis to restart redis
  4. use redis-cli ping to check if redis is on, if it is it should return 'pong'
@nonlogos
nonlogos / index.html
Last active June 15, 2018 17:30
Nested Object Search
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
@nonlogos
nonlogos / sinon_spy.js
Created December 15, 2017 21:42
Unit testing suing Sinon
// only spies on the function but does not change its behavior
// SPY: basic anonymous spy example
function testMe(callback) {
callback();
}
// testing function
describe('testMe funciton', () => {
@nonlogos
nonlogos / composing_reduce.js
Last active December 11, 2017 14:42
optional reduce arguments patterns
function increment(input) {return input + 1}
function decrement(input) {return input - 1}
function double(input) {return input * 2}
var initial_value = 1;
// put a chain of functions in a pipeline array
var pipeline = [
increment,
double,