Skip to content

Instantly share code, notes, and snippets.

@alexholehouse
alexholehouse / gist:6190193
Last active December 4, 2018 17:03
n-dimensional arrays in Python
## Function to create an n-dimensional array
# Main function to call
# typeOfitem
# Should be a class which can generate objects
# e.g. float, int, complex, or any other type, such as
# myCoolClass
#
# dimensions
# value for a 1D array, or a list or tuple defining the
@aras-p
aras-p / preprocessor_fun.h
Last active June 2, 2025 18:02
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 19, 2025 18:08
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@Aenigma
Aenigma / .gitignore
Last active October 19, 2017 01:10
Constitution for the FSU Computer Club
build/
@willryan
willryan / port_open.rb
Created January 13, 2015 18:27
Checking if a TCP port is in use
def is_port_open?(ip, port)
begin
Timeout::timeout(20) do
begin
s = TCPSocket.new(ip, port)
s.close
return true
rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH
return false
end
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 2, 2025 12:42
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@hnykda
hnykda / keras.py
Last active June 15, 2023 04:11
Tada's usage (see discussion)
""" From: http://danielhnyk.cz/predicting-sequences-vectors-keras-using-rnn-lstm/ """
from keras.models import Sequential
from keras.layers.core import TimeDistributedDense, Activation, Dropout
from keras.layers.recurrent import GRU
import numpy as np
def _load_data(data, steps = 40):
docX, docY = [], []
for i in range(0, data.shape[0]/steps-1):
docX.append(data[i*steps:(i+1)*steps,:])
@adeekshith
adeekshith / .git-commit-template.txt
Last active October 20, 2024 21:10 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@lowleveldesign
lowleveldesign / UpdateChocolatey.bat
Last active March 11, 2025 17:21
Scripts to automatically update all Chocolatey packages installed on your system
@echo off
powershell -NoProfile -ExecutionPolicy ByPass -File "%~d0%~p0%~n0.ps1"
#!/usr/bin/env python
from collections import defaultdict
from pprint import pprint
import random
from pulp import *
def generate_trips(route_names, start_hour, end_hour):