Skip to content

Instantly share code, notes, and snippets.

@sellout
sellout / color-theme-solarized.el
Created Mar 26, 2011
First step of a Solarized color theme for Emacs (http://ethanschoonover.com/solarized)
View color-theme-solarized.el
(eval-when-compile
(require 'color-theme))
(defun color-theme-solarized (mode)
"Color theme by Ethan Schoonover, created 2011-03-24.
Ported to Emacs by Greg Pfeil, http://ethanschoonover.com/solarized."
(interactive "Slight or dark? ")
(let ((base03 "#002b36")
(base02 "#073642")
(base01 "#586e75")
@baali
baali / MajorClust.py
Last active May 28, 2016
MajorClust algorithm implementation using sklearn based on SO conversation about text clustering using python(http://stackoverflow.com/questions/1789254/clustering-text-in-python).
View MajorClust.py
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import linear_kernel
import numpy as np
from itertools import combinations
from random import shuffle
def majorclust_sklearn():
texts = [
"foo blub baz",
"foo bar baz",
@edrex
edrex / camlistore-server-vps-s3.md
Last active Jun 8, 2016
Camlistore on a VPS with S3 blob storage
View camlistore-server-vps-s3.md

Let's set up Camlistore on a Linux server, with blobs stored in s3. This seems to be the currently best-supported option for "cloud" deployment.

This is meant as a supplement to the official server config doc. Read through both docs before you start.

http://camlistore.org/docs/server-config

This blog post is also recommended reading.

I've posted my config files for reference, but they will be created the first time you run camlistored (for the server) and camput init (for the client) so don't copy them.

View New Years Resolution - Learn eLisp For Emacs
Interested in learning eLisp for Emacs, ever thought you should?
I wanted to learn eLisp but there are no decent beginners' book - so I decided to write one - and by decent I mean super-basic starting assuming you know nothing at all.
It is my 'official' side-project; something to work on when I am bored or blocked in my main work.
You can see how much progress I have made here:
http://learn-elisp-for-emacs.org/
The book will get written quicker if other people muck in.
@zzgvh
zzgvh / restricted_user_projects_by_org.py
Created Aug 8, 2018
Alternative project access restriction model
View restricted_user_projects_by_org.py
class RestrictedUserProjectsByOrg(models.Model):
user = models.OneToOneField('User', related_name='restricted_projects')
organisation = models.ForeignKey('Organisation', related_name='restricted_users')
is_restricted = models.BooleanField(default=False) #do we need this?
restricted_projects = models.ManyToManyField(
'Project', related_name='inaccessible_by', null=True, blank=True)
"""
Descriptions of events and pseudo code. One question I haven't thought through is multiple employments
by both user and admin
@punchagan
punchagan / .gitignore
Last active Oct 17, 2019
Whatsapp Broadcast Export to Zulip
View .gitignore
*.zip
*.jpg
/*.txt
@nullpofy
nullpofy / .gitignore
Created Aug 5, 2010
HTML5 Presentation export for Org-mode
View .gitignore
README.html
@alysonla
alysonla / active-issues.sql
Last active Nov 28, 2019
Queries that power the open source section of the 2016 Octoverse report https://octoverse.github.com/
View active-issues.sql
-- Active issues
-- Count of total active issues in the specified time frame
-- Source: githubarchive public data set via Google BigQuery http://githubarchive.org/
SELECT
COUNT(DISTINCT JSON_EXTRACT_SCALAR(events.payload, '$.issue.id')) AS events_issue_count
FROM (SELECT * FROM TABLE_DATE_RANGE([githubarchive:day.],TIMESTAMP('2015-09-01'),TIMESTAMP('2016-08-31')))
AS events
-- 10,723,492 active issues
@dmedvinsky
dmedvinsky / xwrits-lock-hooks.diff
Created Sep 1, 2010
Adds ability to execute sh scripts in xwrits before lock and after unlock.
View xwrits-lock-hooks.diff
diff -u xwrits-2.26//main.c xwrits/main.c
--- xwrits-2.26//main.c 2009-04-04 01:17:02.000000000 +0400
+++ xwrits/main.c 2010-09-01 14:06:52.531052264 +0400
@@ -10,6 +10,7 @@
#ifdef HAVE_XINERAMA
#include <X11/extensions/Xinerama.h>
#endif
+#include <signal.h>
static Options onormal;
@zflat
zflat / pg_migrate_steps.sh
Last active Mar 27, 2020
Migrate pg dump from Heroku to local sqlite3 development (and beyond)
View pg_migrate_steps.sh
# Export the Heroku PG database to a local dump file
# https://devcenter.heroku.com/articles/heroku-postgres-import-export#export
heroku pgbackups:capture
curl -o latest.dump `heroku pgbackups:url`
# Install postregs & Setup password
# https://help.ubuntu.com/community/PostgreSQL
# List databases
sudo -u postgres psql -l
You can’t perform that action at this time.