Skip to content

Instantly share code, notes, and snippets.

Jean Nassar masasin

Block or report user

Report or block masasin

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
filtered_freq = [f if (950 < index < 1050 and f > 1) else 0 for index, f in enumerate(freq)]
masasin /
Last active Aug 9, 2016
Salary calculator for Alberta - Hourly wage to yearly net
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Convert an hourly wage to weekly, monthly, and (gross and net) yearly incomes.
Assumes that work is being done in Alberta, Canada.
from __future__ import division, print_function
import argparse
masasin /
Last active Nov 28, 2015
Code cleanup for /u/SquidgeyBear. (See thread at, and comment at
#!/usr/bin/env python3
Runs a simulation of a traffic light cycle.
Written by /u/masasin as code cleanup for /u/SquidgeyBear. See the original
thread at, and the explanatory comments at
from itertools import cycle
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Automate merging of git branches
# Copyright © 2015 Jean Nassar
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Get a list of network interfaces on Linux
# Copyright © 2015 Jean Nassar
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
masasin / Niko Nico Ordering Process
Last active Aug 29, 2015
Niko Nico Ordering Process
View Niko Nico Ordering Process
// customer cancels
/receive cancel request/;
cancel order;
// customer orders
/receive order/;
if urgent {
masasin / yozakura
Created Apr 3, 2015
Client code to test yozakura's server
View yozakura
import pickle
import socket
import time
# Create a socket (SOCK_STREAM means a TCP socket)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Connect to server and send data
sock.connect(("localhost", 9999))
masasin /
Created Feb 12, 2015
Calculate Kerbin-Duna Aldrin cycler periods in KSP
def calculate_periods(precision=1e-1, periods_to_check=1000, print_first_n=7):
"""Calculate optimal orbital periods for a Kerbin-Duna cycler.
This assumes that the cyclers will have the same orbital period as the
synodic period. Multiples of this period are also acceptable, but the
results will need to be modified accordingly.
All arguments are optional.
You can’t perform that action at this time.