Skip to content

Instantly share code, notes, and snippets.

View stefan2904's full-sized avatar
🚲
¯\_(ツ)_/¯

Stefan stefan2904

🚲
¯\_(ツ)_/¯
View GitHub Profile
@shahril96
shahril96 / garden_puzzle_z3.py
Created May 28, 2017 23:41
Using Z3 Theorem Solver to solve for Gardens Puzzle
import sys
import itertools
from z3 import *
#
# Original puzzle
#
'''
Five friends have their gardens next to one another, where they grow three kinds of crops:
@max-mapper
max-mapper / bibtex.png
Last active March 10, 2024 21:53
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@simonw
simonw / recover_source_code.md
Last active January 16, 2024 08:13
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb

How to contact me

After some stalking problems I stopped using these accounts. I will repost when I have new info.

anonymous
anonymous / list27.txt
Created May 8, 2016 17:40
000(023Rb|001Rb)
001(017La|002Rb)
002(021La|003Rb)
003(021La|004La)
004(009Rb|005Lb)
005(004Ra|005La)
006(008La|007La)
007(009Rb|007La)
008(009Ra|008La)
009(010Ra|026Ra)
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active May 3, 2024 15:54
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@mrworf
mrworf / VerifiedHttpClient.java
Created May 4, 2016 14:09
Android HttpClient with cert pinning
/**
* Copyright 2016 Henric Andersson
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@alphapapa
alphapapa / helm-org-tag-completion.el
Last active December 21, 2022 15:45
Complete multiple org-mode tags with helm
;;;;;; Fix Helm org tag completion
;; From Anders Johansson <https://groups.google.com/d/msg/emacs-helm/tA6cn6TUdRY/G1S3TIdzBwAJ>
;; This works great! He posted it on 3 Mar 2016, on a thread that was
;; started in Oct 2013. He also posted this message on 2 Apr 2014,
;; maybe an earlier attempt at a solution:
;; <http://article.gmane.org/gmane.emacs.orgmode/84495> I've just
;; tidied it up a bit and adjusted the prompt.
(add-to-list 'helm-completing-read-handlers-alist '(org-capture . aj/org-completing-read-tags))
@sprig
sprig / setup-emacs-fonts.el
Created March 11, 2016 22:30
Config to set up nice fonts in emacs
(defun kk/setup-fonts (&rest args)
(interactive)
(set-face-font 'default "Source Code Pro for Powerline-11")
(set-fontset-font t 'hebrew (font-spec :name "Courier New-11"))
)
(advice-add 'server-create-window-system-frame :after 'kk/setup-fonts)
(advice-add 'server-create-tty-frame :after 'kk/setup-fonts)
(unless (daemonp) (kk/setup-fonts))
@parmentf
parmentf / GitCommitEmoji.md
Last active May 2, 2024 20:29
Git Commit message Emoji