Skip to content

Instantly share code, notes, and snippets.

View sarnthil's full-sized avatar
🇺🇦
🐐

Laura Oberländer sarnthil

🇺🇦
🐐
View GitHub Profile
@moyix
moyix / favhelp.txt
Created December 30, 2021 02:32
moyix's favorite TeX '82 help messages
I'm broken. Please show this to someone who can fix can fix
--
I dddon't go any higher than filll.
--
Things are pretty mixed up, but I think the worst is over.
--
Sorry, I don't know how to help in this situation.
Maybe you should try asking a human?
--
If you really absolutely need more capacity,
@L3viathan
L3viathan / yp.py
Created November 20, 2021 08:45
Python palindrome detector that consists of palindromes. cat yp.py | python yp.py
exec("\n".join(l[:len(l)//2+1].strip().replace("X"," "*4)for l in"""ni l rof)4*" ","X"(ecalper.)(pirts.]1+2//)l(nel:[l(nioj."n\"(cexe
import sysys tropmi
for l in sys.stdin.readlines():)(senildaer.nidts.sys ni l rof
XL=l.rstrip("\\n");print(L==L[::-1])]1-::[L==L(tnirp;)"n\\"(pirtsr.l=LX
))]1-:1[)"n\"(tilps.""".split("\n")[1:-1]))
@robinhouston
robinhouston / gist:6c74a607a7ee8d4553feead2828107d9
Created September 17, 2020 14:28
3×3 troll-square matrices with two-digit entries
sage: %paste
def cgfh(cg_plus_fh):
for cg in range(1, cg_plus_fh):
fh = cg_plus_fh - cg
for c in divisors(cg):
for f in divisors(fh):
yield (c, cg//c, f, fh//f)
for r in range(1, 99, 2):
cg_plus_fh = (101^2 - r^2)/4
@evanmiltenburg
evanmiltenburg / levelt.tex
Created April 26, 2018 12:08
Levelt's model of speech production
\documentclass[12pt]{standalone}
\usepackage{tgtermes}
\usepackage{tgheros}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{calc}
@blabber
blabber / mastodoji.txt
Last active April 27, 2017 08:20
A collection of #mastodoji (https://chaos.social/@blinry/66833)
moved to: https://github.com/blabber/mastodoji

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@L3viathan
L3viathan / nummagic.py
Created January 5, 2016 14:51
Shenanigans abusing magic methods
import random
import math
class Num(object):
def __init__(self, val):
self.value = val
self.bit = False
def __repr__(self):
return str(self.value)
def __abs__(self):
return self

NLTK API to Stanford NLP Tools compiled on 2015-12-09

Stanford NER

With NLTK version 3.1 and Stanford NER tool 2015-12-09, it is possible to hack the StanfordNERTagger._stanford_jar to include other .jar files that are necessary for the new tagger.

First set up the environment variables as per instructed at https://github.com/nltk/nltk/wiki/Installing-Third-Party-Software

@daneden
daneden / Instructions.md
Created December 1, 2015 00:25
Remap Caps Lock to Emoji on Mac

How to remap the caps lock key to the emoji selector on Mac

  1. Go to System Preferences -> Keyboard -> Modifier Keys...
  2. Change “Caps Lock” to “No action”
  3. Install Seil
  4. Change the Caps Lock key in Seil to keyCode 80 (F19)
  5. Install Karabiner
  6. Open Karabiner and go to Misc & Uninstall -> Open private.xml
  7. Copy the contents of this gist's example to the XML file and save
  8. In Karabiner, go to Change Keys -> Reload XML
@snehesht
snehesht / Concurrent HTTP Requests with Python3 and asyncio
Last active October 20, 2020 19:00
Concurrent HTTP Requests with Python3 and asyncio
#http://geekgirl.io/concurrent-http-requests-with-python3-and-asyncio/
Concurrent HTTP Requests with Python3 and asyncio
My friend who is a data scientist had wipped up a script that made lots (over 27K) of queries to the Google Places API. The problem was that it was synchronous and thus took over 2.5hours to complete.
Given that I'm currently attending Hacker School and get to spend all day working on any coding problems that interests me, I decided to go about trying to optimise it.
I'm new to Python so had to do a bit of groundwork first to determine which course of action was best.