My country is under a daylight saving time period and not all my commits are made during the morning/afternoon. Because I commited after 11:00 PM - which, given the local DST, was after 00:00 AM - my 100+ days commit streak got broken - which made me very unhappy.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This file is executed when the Python interactive shell is started if | |
$PYTHONSTARTUP is in your environment and points to this file. It's just | |
regular Python commands, so do what you will. Your ~/.inputrc file can greatly | |
complement this file. | |
Modified from sontek's dotfiles repo on github: | |
https://github.com/sontek/dotfiles | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from weasyprint import HTML, CSS | |
def get_page_body(boxes): | |
for box in boxes: | |
if box.element_tag == 'body': | |
return box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# CORS header support | |
# | |
# One way to use this is by placing it into a file called "cors_support" | |
# under your Nginx configuration directory and placing the following | |
# statement inside your **location** block(s): | |
# | |
# include cors_support; | |
# | |
# As of Nginx 1.7.5, add_header supports an "always" parameter which |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dependency - Function.prototype.bind or underscore/lodash | |
app = angular.module 'someApp' | |
class @BaseCtrl | |
@register: (app, name) -> | |
name ?= @name || @toString().match(/function\s*(.*?)\(/)?[1] | |
app.controller name, @ | |
@inject: (args...) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import Column, ForeignKey, Integer, String, ForeignKeyConstraint | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker, relationship | |
Model = declarative_base() | |
class Parent(Model): | |
__tablename__ = 'parent' | |
id = Column(Integer, primary_key=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# To the extent possible under law, Viktor Szakats | |
# has waived all copyright and related or neighboring rights to this | |
# script. | |
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/ | |
# SPDX-License-Identifier: CC0-1.0 | |
# THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package proxy | |
import ( | |
"io" | |
"net" | |
"sync" | |
log "github.com/Sirupsen/logrus" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
To use: | |
1. Install [Ansible](https://www.ansible.com/) | |
2. Setup an Ubuntu 16.04 server accessible over ssh | |
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Lightweight script to detect whether the browser is running in Private mode. | |
* @returns {Promise<boolean>} | |
* | |
* Live demo: | |
* @see https://output.jsbin.com/tazuwif | |
* | |
* This snippet uses Promises. If you want to run it in old browsers, polyfill it: | |
* @see https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js | |
* |
OlderNewer