Skip to content

Instantly share code, notes, and snippets.

@mblondel
mblondel / einsum.py
Created May 22, 2015 05:36
Einstein sum notation
import numpy as np
rng = np.random.RandomState(0)
print "Trace"
A = rng.rand(3, 3)
print np.trace(A)
print np.einsum("ii", A)
print
@bitops
bitops / hipchat.el
Last active November 14, 2019 20:09
HipChat + jabber.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; use jabber-connect to connect. Make sure you tab to select the hipchat account if it's the ;;
;; only connection configured. ;;
;; ;;
;; a fork of https://gist.github.com/puffnfresh/4002033 ;;
;; ;;
;; shout out to http://emacs.stackexchange.com/questions/10940/connecting-to-hipchat-xmpp-via-jabber-el ;;
;; for the help. ;;
;; ;;
;; you can look up the necessary jabber info on the account i
@NicolasT
NicolasT / Conc.lhs
Last active May 25, 2017 03:15
Deriving Typeclass Instances using Typed Holes
# Deriving Typeclass Instances using Typed Holes
> module Conc where
> import Control.Applicative
We're presented with the following structure:
> data Concurrent a = Concurrent ((a -> Action) -> Action)
> data Action = Atom (IO Action)
> | Fork Action Action
@davidfraser
davidfraser / uninstall-evernote-cleanup
Created December 29, 2014 09:26
Script to cleanup an Evernote installation under Wine, in order to allow reinstallation - see http://www.sgvulcan.com/evernote-under-wine-already-installed-by-another-user/
#!/bin/bash
echo first uninstall evernote using the wine uninstaller
wine uninstaller
echo now searching forregistry entry to remove
cd ~/.wine/drive_c/windows/profiles/$USER/temp
upgrade_code="`grep 'with upgrade code' EvernoteSetup.log | tail -n 1 | sed 's/^.*with upgrade code {\([A-Fa-f0-9-]*\).*$/\1/'`"
reverse_upgrade_code="`python -c "x='${upgrade_code}' ; y = x[:18].split('-') ; x = x.replace('-', '') ; z = [a+b for a, b in zip(x[16::2], x[17::2])] ; print ''.join(''.join(reversed(part)) for part in y+z).upper()"`"
echo please use regedit to navigate to '\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\' and remove the key "$reverse_upgrade_code"
wine regedit
@sberke
sberke / Demo of plantUML in ipython notebook.ipynb
Last active December 9, 2020 01:46
Demo of plantUML in ipython notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"Envelope" : {
"WARC-Header-Length" : "578",
"Block-Digest" : "sha1:YHKQUSBOS4CLYFEKQDVGJ457OAPD6IJO",
"Format" : "WARC",
"Actual-Content-Length" : "43428",
"WARC-Header-Metadata" : {
"WARC-Record-ID" : "<urn:uuid:ffbfb0c0-6456-42b0-af03-3867be6fc09f>",
"WARC-Warcinfo-ID" : "<urn:uuid:3169ca8e-39a6-42e9-a4e3-9f001f067bdf>",
"Content-Length" : "43428",
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active May 1, 2024 03:45
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@amar-analytx
amar-analytx / spark-ec2.py
Last active August 29, 2015 14:04
Spark EC2 with VPC
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@stared
stared / software_for_scientists.md
Last active December 5, 2023 17:16
Software for scientists: community-edited list of general-purpose software for scientists.

Software for scientists

Some things takes much less time and stress once you know the right tool. Below, there is a community edited list of software for scientists.

Text editors

in General purpose text/code editors. It may be better to have a good editor for everything, than different ones for different languages, scripts, notes.