Skip to content

Instantly share code, notes, and snippets.

View iho's full-sized avatar
🏠
Working from home

iho iho

🏠
Working from home
View GitHub Profile
@iho
iho / main.go
Created December 16, 2018 10:41 — forked from mendelgusmao/main.go
.zsh_history merge+remove duplicate lines
package main
import (
"fmt"
"io/ioutil"
"os"
"regexp"
"sort"
"strconv"
"strings"
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
@iho
iho / announce.php
Created October 7, 2018 14:58 — forked from nsuan/announce.php
Bitstorm Tracker
<?php
/*
* Bitstorm - A small and fast Bittorrent tracker
* Copyright 2008 Peter Caprioli
*
* 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.
*
@iho
iho / .md
Last active January 6, 2018 10:50
Api

Авторизація

Щоб отримати доступ до API потрібно передати свій пароль та пошту на спеціальний адресу та отримати токен

curl -X POST -d "email=greenlatte@opys.xyz&password=greenlatte@opys.xyz" http://stage.gorobets.me:8000/auth/jwt/create/

Потім цей токен потрібно передавати в header в кожному запиті до api "Authorization: JWT <your_token>" Наприклад маючи токен можна дізнатися свій id та пошту:

@iho
iho / IdempotentSQLAlterTableAddColumn.sql
Created May 12, 2016 18:49 — forked from kmoormann/IdempotentSQLAlterTableAddColumn.sql
Idempotent SQL Alter Table Statements
IF NOT EXISTS
(
SELECT * FROM [information_schema].[columns]
WHERE table_name = 'Customer'
AND table_schema = 'dbo'
AND column_name = 'FavoriteColorId'
)
BEGIN
ALTER TABLE [dbo].[Customer]
ADD FavoriteColorId int
@iho
iho / Makefile
Created May 1, 2016 16:19 — forked from nzjrs/Makefile
Python ctypes example
all: test libtest.so testmodule
libtest.so: libtest.c
$(CC) -Wall -g -fPIC -shared -o $@ $? -lc
test: test_main.c libtest.o
$(CC) -o $@ $?
testmodule: testmodule.c
python setup.py build
@iho
iho / demo.py
Created May 1, 2016 15:59 — forked from bwhite/demo.py
Integrating Python + C: Ctypes and Cython
import ctypes
import time
import numpy as np
import example_cython
def mult_sum(a):
b = 0
for i in range(10000):
b += a * i
@iho
iho / gist:96c78bc30ef164ed462fca0b07e61e31
Created April 21, 2016 17:19 — forked from pelagisk/gist:2311852
Vim-cute-python adaptation for emacs?
(defun cute-python ()
(interactive)
(remove-overlays)
(let (
(strings '(
(" != " . " ≢ ")
(" in " . " ∈ ")
(" or " . " ∨ ")
(" and " . " ∧ ")
(" is not " . " ¬ ")
var top_bar_html= `<div id="headbar">
<div id="wrap-headbar">
Subscribe!
<form action="http://mailing.beutl.com/subscribe" method="POST" accept-charset="utf-8" style="display: inline" id="bar-form" >
<input type="email" name="email" id="bar-email-input">
<input type="hidden" name="list" value="le5EE55cSN240vv68lOLPA"/>
<input id="bar-submit-button" type="submit" value="SUBMIT" >
<span id="bar-close-button">X</span>
</form>
@iho
iho / image.js
Created December 16, 2015 23:04 — forked from Snugug/image.js
Image Renderer for Marked (https://github.com/chjj/marked/) to transform it into a media embed tool
var marked = require('marked'),
fs = require('fs'),
path = require('path'),
URI = require('URIjs'),
renderer = new marked.Renderer(),
file = fs.readFileSync('./foo.md', 'utf8');
// Set Marked's rendereer to the custom renderer
// optional `localVideoPath` option will be used to to find fallback videos for `.webm`. Defaults to ''
marked.setOptions({