Skip to content

Instantly share code, notes, and snippets.

View cruisemaniac's full-sized avatar

Ashwin Murali cruisemaniac

View GitHub Profile
@maximebf
maximebf / webtail.py
Created October 21, 2011 13:25
Web tail / tail -f as a webpage using websocket
#!/usr/bin/python
# Equivalent of "tail -f" as a webpage using websocket
# Usage: webtail.py PORT FILENAME
# Tested with tornado 2.1
# Thanks to Thomas Pelletier for it's great introduction to tornado+websocket
# http://thomas.pelletier.im/2010/08/websocket-tornado-redis/
import tornado.httpserver
@LeZuse
LeZuse / detect.py
Created May 2, 2012 18:28
Flask browser detection
browser = request.user_agent.browser
version = request.user_agent.version and int(request.user_agent.version.split('.')[0])
platform = request.user_agent.platform
uas = request.user_agent.string
if browser and version:
if (browser == 'msie' and version < 9) \
or (browser == 'firefox' and version < 4) \
or (platform == 'android' and browser == 'safari' and version < 534) \
or (platform == 'iphone' and browser == 'safari' and version < 7000) \
@chaos-ad
chaos-ad / install.sh
Last active June 28, 2020 07:27
Installing erlang in ubuntu
#!/bin/bash
# installing erlang on ubuntu's
VERSION="R15B01"
sudo apt-get install build-essential libncurses5-dev openssl libssl-dev
sudo mkdir -p /opt/erlang/
curl -O https://raw.github.com/spawngrid/kerl/master/kerl && chmod a+x kerl
sudo mv kerl /opt/erlang/
@ibeex
ibeex / foo.log
Created August 4, 2012 13:46
Flask logging example
A warning occurred (42 apples)
An error occurred
@labnol
labnol / qr.html
Created October 3, 2012 15:23
Social QR Code
<!-- This template was designed by Amit Agarwal of Digital Inspiration (www.labnol.org) -->
<!-- The design and template is licensed under a Creative Commons Attribution 3.0 License -->
<!-- Please see http://www.labnol.org/?p=25841 for instructions on how to modify the file -->
<html>
<head>
<title>QR Code</title>
<meta name="HandheldFriendly" content="True">
@DHuckaby
DHuckaby / NonsenseGenerator.java
Created October 30, 2012 13:26
This generator can construct headlines and news articles by randomly composing sentences.
/*
* Copyright (C) 2011 The Android Open Source Project
*
* 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
@huettern
huettern / ocbackup.sh
Created September 19, 2017 18:41
ownCloud Backup script
#!/bin/bash
# Author: noah huetter - dlatch.com
#
# v2:
# - added database backup
# - partial file transfer for no big file junk on /tmp
# v3:
# - Variables for user settings
# - Comments and functions
@amodm
amodm / weekend-dev-puzzles-list.md
Last active July 9, 2024 16:56
List of all #WeekendDevPuzzles

Weekend Dev Puzzle

Some time between 2021-22, I ran a list of puzzles designed to push developers into developing a better understanding of the technologies they use on a day to day basis. Each puzzle is designed to be fun, provocative, and short.

This is a complete list of those puzzles. Each link takes you to the tweet where I first posed the problem. If you like any of them, please feel free to share with others.

Edit (2024-01-27): Adding other puzzles to this 2024 onwards. Criteria:

  1. Problem statement should be understandable by most in s/w tech, even if the ability to figure it out may not be.
  2. Thinking about the problem should lead to clearer understanding of some foundational concept.
  3. Should be short.
  4. Should be fun to ponder over.