Skip to content

Instantly share code, notes, and snippets.

Theodore Keloglou sirodoht

Block or report user

Report or block sirodoht

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sirodoht
sirodoht / sentry-test-exception.html
Last active Sep 1, 2019
Trigger test event for on premise Sentry
View sentry-test-exception.html
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Sentry test trigger event</title>
</head>
<body>
<script src="https://browser.sentry-cdn.com/5.6.3/bundle.min.js" integrity="sha384-/Cqa/8kaWn7emdqIBLk3AkFMAHBk0LObErtMhO+hr52CntkaurEnihPmqYj3uJho" crossorigin="anonymous"></script>
<script>
@sirodoht
sirodoht / go-build.sh
Created Aug 7, 2019
Build golang programs for linux, win, macos, all 64bit
View go-build.sh
#!/bin/bash
#
# Golang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script:
# https://dave.cheney.net/2015/08/22/cross-compilation-with-go-1-5
# https://gist.github.com/eduncan911/68775dba9d3c028181e4
PLATFORMS="darwin/amd64 windows/amd64 linux/386"
type setopt >/dev/null 2>&1
View normalize.css
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
@sirodoht
sirodoht / slugify
Last active Nov 14, 2018
Slugify CLI tool in Python
View slugify
#!/usr/bin/env python3
# Usage:
# slugify any thing here really
# Stolen from Django:
# https://github.com/django/django/blob/277017aea4cf72a1797102e6d129165181d04e17/django/utils/text.py#L386
import re
@sirodoht
sirodoht / postgres-dump-restore.md
Last active Aug 30, 2019
How to dump and restore in Postgres using custom format
View postgres-dump-restore.md

How to dump and restore in Postgres

Dump

$ pg_dump -h localhost -p 5432 -U dbuser -F c -b -v -f "./dump" dbname

Restore

@sirodoht
sirodoht / restore-django-postgres-dokku.md
Last active Sep 15, 2018
How to restore Django Postgres on dokku (using dokku-postgres plugin backup)
View restore-django-postgres-dokku.md

First download the backup from S3. Should be in the form:

postgres-appname-2018-09-14-07-00-04.tgz

Then, delete your local db (or rename it).

Re-create (empty) db (guide).

Then extract, and cd into backup folder. There, the pg dump called export should reside. Execute:

View gpg-expire.sh
$ gpg --list-secret-keys
$ gpg --edit-key XXX
gpg> expire
gpg> key 1
gpg> expire
gpg> save
$ gpg --list-secret-keys
@sirodoht
sirodoht / go-build-all
Last active Feb 26, 2019 — forked from eduncan911/go-build-all
Go Cross-Compile Script (forked for amd64 macos, linux, windows)
View go-build-all
#!/bin/bash
#
# GoLang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script:
# http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go
#
# To use:
#
# $ cd ~/path-to/my-awesome-project
# $ go-build-all
#
@sirodoht
sirodoht / longest_collatz_sequence.rs
Created Jan 31, 2018
Longest Collatz sequence solution, Project Euler #14
View longest_collatz_sequence.rs
// Longest Collatz sequence
// https://projecteuler.net/problem=14
fn collatz(num: u32) -> u32 {
if num == 1 {
return num;
}
if num % 2 == 0 {
num / 2
@sirodoht
sirodoht / index.html
Last active Nov 3, 2019
Basic HTML/CSS boilerplate with Normalize.css and jQuery
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
You can’t perform that action at this time.