Skip to content

Instantly share code, notes, and snippets.

View AlexJoz's full-sized avatar

Alex Joz AlexJoz

  • uk
  • 16:26 (UTC +01:00)
View GitHub Profile
@erinzm
erinzm / aoc_day_01.py
Last active December 1, 2016 07:58
AOC: Day 1
import re, math
with open('input') as f:
puzzleinput = f.read()
position=[0, 0]
face = 0 # along y axis, incrementing goes cw
dpos = {0: [0, 1], 1: [1, 0], 2: [0, -1], 3: [-1, 0]}
position_stack = [position[:]]; ans2_found = False
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active May 7, 2024 10:38
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@tomzx
tomzx / gist:aa2d9172a1daef15a0ac
Created January 7, 2015 02:41
./gradlew: Permission denied
/home/travis/build.sh: line 175: ./gradlew: Permission denied
Fix by setting the executable flag on your gradlew file.
Either
chmod +x gradlew (on unix systems)
OR
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 2, 2024 05:49
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@rla
rla / code.cpp
Created July 23, 2012 13:12
Sending JSON POST request with Qt
void SyncService::sync()
{
QUrl url(SYNC_URL);
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),
@endolith
endolith / frequency_estimator.py
Last active May 8, 2024 17:59
Frequency estimation methods in Python
from __future__ import division
from numpy.fft import rfft
from numpy import argmax, mean, diff, log, nonzero
from scipy.signal import blackmanharris, correlate
from time import time
import sys
try:
import soundfile as sf
except ImportError:
from scikits.audiolab import flacread