Skip to content

Instantly share code, notes, and snippets.

View HauptJ's full-sized avatar
:octocat:
Tschüss STL

Joshua Haupt HauptJ

:octocat:
Tschüss STL
View GitHub Profile

Having no excuses to disable SELinux

Is this thing on?

$ getenforce
Enforcing

$ sestatus
SELinux status:                 enabled
@jreyes33
jreyes33 / postman-playbook.yml
Last active April 22, 2019 17:55
Install Postman with Ansible on Linux
# …
tasks:
- name: Inspect postman file
stat: path=~/bin/Postman/Postman
register: postman_file
- name: Install postman
when: not postman_file.stat.exists
unarchive:
remote_src: yes
@thedevsaddam
thedevsaddam / ReadFile.go
Created January 16, 2017 05:20 — forked from pagoenka/ReadFile.go
Reading file, line by line in Go lang using scanner
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
@STashakkori
STashakkori / triple_byte_programming_challenge.py
Created March 5, 2016 15:32
Triplebyte Programming Challenge Python
__author__ = 'sina'
def main():
f("12365212354", 26)
def f(numbers, target):
for i in range(1, len(numbers)):
current = int(numbers[0:i])
to_end = numbers[i:-1]
evaluate(0, current, to_end, target, current)
@bemasher
bemasher / stack.go
Last active August 19, 2020 10:59
A simple LIFO stack backed by a linked list implemented with golang.
package main
import (
"fmt"
)
type Stack struct {
top *Element
size int
}
@ardan-bkennedy
ardan-bkennedy / GoMgoSample-1.go
Last active February 27, 2021 08:31
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {
@hygull
hygull / Matrix multiplication in Golang(2 matrices of order 3x3).go
Last active October 23, 2021 21:23
Matrix multiplication in Golang(2 matrices of order 3x3) created by hygull - https://repl.it/Et8I/2
/*
{
"date_of_creation" => "19 Dec 2016, Mon",
"aim_of_program" => "Matrix multiplication in Golang",
"coded_by" => "Rishikesh Agrawani",
"Go_version" => "1.7",
}
*/
package main
@maksadbek
maksadbek / golang-linked-list.go
Created April 27, 2016 21:43
golang linked list implementation
package main
import "fmt"
type Node struct {
prev *Node
next *Node
key interface{}
}
@iamkevinlowe
iamkevinlowe / triplebyte_programming_challenge.rb
Created December 15, 2015 23:22
Triplebyte Programming Challenge
# The first 12 digits of pi are 314159265358. We can make these digits into an expression evaluating to 27182 (first 5 digits of e) as follows:
# 3141 * 5 / 9 * 26 / 5 * 3 - 5 * 8 = 27182
# or
# 3 + 1 - 415 * 92 + 65358 = 27182
# Notice that the order of the input digits is not changed. Operators (+,-,/, or *) are simply inserted to create the expression.
# Write a function to take a list of numbers and a target, and return all the ways that those numbers can be formed into expressions evaluating to the target. Do not use the eval function in Python, Ruby or JavaScript
@dideler
dideler / pyargs.md
Last active January 23, 2023 16:39
Parsing Command-Line Argument in Python

Command-line arguments in Python show up in sys.argv as a list of strings (so you'll need to import the sys module).

For example, if you want to print all passed command-line arguments:

import sys
print(sys.argv)  # Note the first argument is always the script filename.

Command-line options are sometimes passed by position (e.g. myprogram foo bar) and sometimes by using a "-name value" pair (e.g. myprogram -a foo -b bar).