Skip to content

Instantly share code, notes, and snippets.

@actindi
actindi / stackoverflow.ipynb
Created September 17, 2018 23:24
Stackoverflowにはいつ質問すれば早く回答を得られやすいのか
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@attacus
attacus / riot-matrix-workshop.md
Last active March 13, 2024 00:16
Create your own encrypted chat server with Riot and Matrix

This guide is unmaintained and was created for a specific workshop in 2017. It remains as a legacy reference. Use at your own risk.

Running your own encrypted chat service with Matrix and Riot

Workshop Instructor:

This workshop is distributed under a CC BY-SA 4.0 license.

What are we doing here?

@kechol
kechol / greetings.coffee
Last active August 29, 2015 14:09
挨拶スクリプト for Hubot
# Description:
# hubot scripts to greet members friendly
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
@imontantes
imontantes / SlotMachine
Created October 3, 2012 18:54
Slot Machine in Python
import random
print('''Welcome to the Slot Machine Simulator
You'll start with $50. You'll be asked if you want to play.
Answer with yes/no. you can also use y/n
No case sensitivity in your answer.
For example you can answer with YEs, yEs, Y, nO, N.
To win you must get one of the following combinations:
BAR\tBAR\tBAR\t\tpays\t$250
BELL\tBELL\tBELL/BAR\tpays\t$20
PLUM\tPLUM\tPLUM/BAR\tpays\t$14
@rweeks
rweeks / gist:3708161
Created September 12, 2012 17:03
Tornado + redis-py pub/sub
class TileServer(tornado.web.Application):
def __init__(self, handlers=None, default_host="", transforms=None,
wsgi=False, **settings):
"""
In addition to invoking the superclass constructor, initializes the per-server redis client and per-server
redis pubsub handler.
"""
tornado.web.Application.__init__(self, handlers, default_host, transforms, wsgi, **settings)
self._rc = redis.StrictRedis(**(settings.get('redis_config', {}))) # redis client: one per application
self._rcps = self._rc.pubsub() # redis pubsub obj: one per application
@paulmillr
paulmillr / active.md
Last active May 15, 2024 02:25
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1000)
@odiak
odiak / scanf.py
Created December 16, 2011 23:59
scanf.py
#!/usr/bin/env python
# coding: utf-8
# scanf.py - written by odiak
#
# example.
# i, f = scanf('%d%d')
# s = scanf('%s')
import sys
@jacqui
jacqui / gist:983051
Created May 20, 2011 14:43 — forked from pauldix/gist:981916
Redis SORT command examples
# Optimized for writes, sort on read
# LVC
redis.hset("bonds|1", "bid_price", 96.01)
redis.hset("bonds|1", "ask_price", 97.53)
redis.hset("bonds|2", "bid_price", 95.50)
redis.hset("bonds|2", "ask_price", 98.25)
redis.sadd("bond_ids", 1)
redis.sadd("bond_ids", 2)
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active May 16, 2024 16:51
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh