Skip to content

Instantly share code, notes, and snippets.

Thomas Schouten PHPirates

Block or report user

Report or block PHPirates

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
@PHPirates
PHPirates / build.gradle
Last active Apr 6, 2019 — forked from thomas15v/build.gradle
Debug your Jetbrains plugin in non-IntelliJ IDEs, in this example we use PyCharm. To use: run the runIde task.
View build.gradle
plugins {
id "org.jetbrains.intellij" version "0.3.12"
id "maven"
id "de.undercouch.download" version "3.4.3"
// Plugin which can check for Gradle dependencies, use the help/dependencyUpdates task.
id 'com.github.ben-manes.versions' version '0.20.0'
// Plugin which can update Gradle dependencies, use the help/useLatestVersions task.
@PHPirates
PHPirates / CtrlAltS.ahk
Created Oct 11, 2018
Autohotkey backups
View CtrlAltS.ahk
^!S::
{
Run, "C:\Windows\Sysnative\SnippingTool.exe"\
WinWaitActive, Snipping Tool
Send ^n
}
@PHPirates
PHPirates / pointers.c
Created Oct 6, 2018
Quick reference on C pointers
View pointers.c
/**
* @file pointers
* @brief A hello world example.
*
* This a file with some pointers. Documentation can be generated with doxygen.
*/
#include <stdio.h>
/**
@PHPirates
PHPirates / updating-python.rst
Last active Mar 8, 2019
How to update Python and projects with dependencies on Windows
View updating-python.rst

Updating Python (This step Windows only)

  1. Install a new python version from https://www.python.org/downloads/windows/ the 64 bit web installer
  2. Make sure your PATH only contains the paths to the new version
  3. Delete the old python
  4. Restart your pc and test in cmd with python -V

Updating the basic Python packages

  1. Update global setuptools by running in cmd (sudo) python -m pip install -U setuptools. If this fails with a PermissionError, try pip install setuptools --upgrade --ignore-installed.
@PHPirates
PHPirates / levmar.log
Created Aug 3, 2018
Attempt at using levmar
View levmar.log
download libblas.dll, libblas.lib, liblapack.dll, liblapack.lib from https://icl.cs.utk.edu/lapack-for-windows/lapack/#libraries_mingw to lib/
Add to `stack.yaml`:
extra-deps:
- bindings-levmar-1.1.0.5
# - levmar-1.2.1.8 -- Does not support base 4.9 at the moment. A more up to date fork is used
- github: PHPirates/levmar
commit: f36ef9ae1c0d44950a28a445d4f459257f77dd4d
@PHPirates
PHPirates / sample-bibtex.tex
Created Jul 29, 2018
Sample file for testing bibtex bibs.
View sample-bibtex.tex
\begin{filecontents}{main.bib}
@Book{knuth1990,
author = {Knuth, Donald E.},
title = {The {\TeX}book},
year = {1990},
isbn = {0-201-13447-0},
publisher = {Addison\,\textendash\,Wesley},
}
\end{filecontents}
View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@PHPirates
PHPirates / multiple-git-user-ssh.rst
Last active Oct 28, 2018
Set up another git user with ssh
View multiple-git-user-ssh.rst
  1. Generate new ssh key pair

    ssh-keygen -t rsa -b 4096 -C "iam@here.com"
  2. Give it a different name than default, e.g. id_rsa_iam.

  3. Add this key to the ssh agent, cd ~/.ssh and ssh-add id_rsa_iam

    If you get the error 'Could not open a connection to your authentication agent.' then start the ssh-agent with

@PHPirates
PHPirates / git-bundles.md
Last active Oct 6, 2019
How to use git bundles
View git-bundles.md

Let machine M be the Main machine with the repo, and A the Auxiliary machine which wants to help out.

First time setup

  1. Machine M creates bundle with complete repo:
git bundle create repo.bundle HEAD master
  1. M sends repo.bundle to A.
  2. A clones repo from bundle:
@PHPirates
PHPirates / StuffContainer.kt
Last active Mar 7, 2018
Example of use of replaceWith in Kotlin
View StuffContainer.kt
class StuffContainer(val context: Context?) {
private val prefs = android.preference.PreferenceManager.getDefaultSharedPreferences(context)
/** This is stuff. */
var stuff: Boolean
get() = prefs.getBoolean("stuffkey", false)
set(value) {
prefs.edit().putBoolean("stuffkey", value).apply()
}
You can’t perform that action at this time.