Skip to content

Instantly share code, notes, and snippets.

View bitrut's full-sized avatar

Paweł Kowalski bitrut

View GitHub Profile
@pazdera
pazdera / adapter.py
Created August 15, 2011 07:38
Example of `adapter' design pattern in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example of `adapter' design pattern
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@rolo
rolo / gist:1481128
Created December 15, 2011 13:44
Install Postgres 9.1, PostGIS and create PostGIS template on Ubuntu 11.10 Oneiric Ocelot
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active June 13, 2024 10:59
A badass list of frontend development resources I collected over time.
@avalanchy
avalanchy / gae_venv.md
Last active December 22, 2015 02:28
Google App Engine and Virtualenv (Python 2.7)

Lets download SDK to /tmp. I assume that Virtualenv is already installed.

  1. Unpack
unzip /tmp/google_appengine_<VERSION>.zip -d /usr/local
  1. Create Virtualenv
virtualenv ~/demo
@teamon
teamon / gist:7678184
Last active December 29, 2015 13:39 — forked from bitrut/gist:7676303
db = {
person: {
save: function(obj){
if(obj.id){
return $http.post("/person", obj).then(function(res){
var data = angular.extend({}, obj); // create copy of `obj` + `id` field
data.id = res.data.id;
return data;
})
} else {
@staltz
staltz / introrx.md
Last active July 6, 2024 17:07
The introduction to Reactive Programming you've been missing
@paulirish
paulirish / bling.js
Last active July 3, 2024 20:45
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@kwmiebach
kwmiebach / pytest.md
Last active June 4, 2024 06:29 — forked from amatellanes/pytest.sh
pytest cheat sheet

Usage

(Create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help:

@cocodrips
cocodrips / Sekai-ha-sjis-de-afureteru.py
Created July 30, 2015 02:49
Shift-JIS -> utf-8 in python
import sys
import codecs
if len(sys.argv) < 3:
exit(1)
with codecs.open(sys.argv[2], 'w', 'utf-8') as f:
for line in codecs.open(sys.argv[1], 'r', 'cp932'):
f.write(line)
@astamicu
astamicu / Remove videos from Youtube Watch Later playlist.md
Last active June 30, 2024 09:01
Script to remove all videos from Youtube Watch Later playlist

UPDATED 22.11.2022

It's been two years since the last update, so here's the updated working script as per the comments below.

Thanks to BryanHaley for this.

setInterval(function () {
    video = document.getElementsByTagName('ytd-playlist-video-renderer')[0];

 video.querySelector('#primary button[aria-label="Action menu"]').click();