Skip to content

Instantly share code, notes, and snippets.

View spacegangster's full-sized avatar
💭
Working on Lightpad.ai

Ivan Fedorov spacegangster

💭
Working on Lightpad.ai
View GitHub Profile
@spacegangster
spacegangster / nginx.conf
Last active August 29, 2015 14:25 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
This file has been truncated, but you can view the full file.
/9j/4AAQSkZJRgABAgEAYABgAAD/4QwtRXhpZgAATU0AKgAAAAgABwEyAAIAAAAUAAAAYkdGAAMA
AAABAAUAAEdJAAMAAAABAFgAAIKYAAIAAAAWAAAAdpydAAEAAAAUAAAAAOocAAcAAAfSAAAAAIdp
AAQAAAABAAAAjAAAAPYyMDA5OjAzOjEyIDEzOjQ4OjIzAE1pY3Jvc29mdCBDb3Jwb3JhdGlvbgAA
BZADAAIAAAAUAAAAzpAEAAIAAAAUAAAA4pKRAAIAAAADMDgAAJKSAAIAAAADMDgAAOocAAcAAAe0
AAAAAAAAAAAyMDA4OjAyOjExIDExOjMyOjI0ADIwMDg6MDI6MTEgMTE6MzI6MjQAAAUBAwADAAAA
AQAGAAABGgAFAAAAAQAAATgBGwAFAAAAAQAAAUACAQAEAAAAAQAAAUgCAgAEAAAAAQAACt0AAAAA
AAAASAAAAAEAAABIAAAAAf/Y/+AAEEpGSUYAAQEAAAEAAQAA/9sAQwAQCwwODAoQDg0OEhEQExgo
GhgWFhgxIyUdKDozPTw5Mzg3QEhcTkBEV0U3OFBtUVdfYmdoZz5NcXlwZHhcZWdj/9sAQwEREhIY
FRgvGhovY0I4QmNjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj
Y2Nj/8AAEQgAeACgAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//E
@spacegangster
spacegangster / Query.js
Created April 8, 2016 19:10
Партизанские запросы к Огниву
// Первым делом нужно получить куку ring-session
// Выполните запрос вида:
var auth_response = $.post('/user/signin', {username: "test", password: "test"});
// Придёт JSON-ответ вида {status: "ok", redirect_url: null}.
// Кука будет содержаться в заголовках ответа. Дальнейшие запросы должны содержать эту куку.
// Далее нужно получить т.н. начальные данные:
var initial_data = $.get('/rest/firs')
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _helperPluginUtils() {
const data = require("@babel/helper-plugin-utils");

Keybase proof

I hereby claim:

  • I am spacegangster on github.
  • I am spacegangster (https://keybase.io/spacegangster) on keybase.
  • I have a public key ASBcpD-OPG3YQxM-E_m9qD9j97TQ6NYyb5mwssBeEIqD6go

To claim this, I am signing this object:

@spacegangster
spacegangster / examples.edn
Last active July 10, 2019 09:35
Crux Console examples
[{:title "Space Stocks"
:query {:find [e]
:where [[e :crux.db/id _]]}}
{:title "Add space stocks"
:query [[:crux.tx/put {:crux.db/id 33 :title "Company 3"}]]}]
[:dev] Compiling ...
[:dev] Build failure:
failed to convert sources
{:tag :shadow.build.closure/convert-error, :sources [[:shadow.build.classpath/resource "website/js-main.js"]]}
ExceptionInfo: failed to convert sources
shadow.build.closure/convert-sources*/fn--11183 (closure.clj:1462)
shadow.build.closure/convert-sources* (closure.clj:1432)
shadow.build.closure/convert-sources* (closure.clj:1315)
shadow.build.closure/convert-sources (closure.clj:1649)
@spacegangster
spacegangster / timezones.edn
Last active July 15, 2020 14:52
List of standard timezones, scraped from a popular mailing service
;; UPD hey, I'm not sure now if those zones are correct throughout the year
;; see this https://www.creativedeletion.com/2015/01/28/falsehoods-programmers-date-time-zones.html
;; Sorry for misleading you
[{:option/value "Pacific/Tarawa" :option/label "(GMT +12:00) Tarawa"}
{:option/value "Pacific/Auckland" :option/label "(GMT +12:00) New Zealand Time"}
{:option/value "Pacific/Norfolk" :option/label "(GMT +11:00) Norfolk Island (Austl.)"}
{:option/value "Pacific/Noumea" :option/label "(GMT +11:00) Noumea, New Caledonia"}
{:option/value "Australia/Sydney" :option/label "(GMT +10:00) Australian Eastern Time (Sydney)"}
{:option/value "Australia/Queensland" :option/label "(GMT +10:00) Australian Eastern Time (Queensland)"}
{:option/value "Australia/Adelaide" :option/label "(GMT +9:30) Australian Central Time (Adelaide)"}
@spacegangster
spacegangster / bem.cljc
Last active November 9, 2020 05:17
Add modifiers to CSS classes as in BEM naming (in Clojure)
(ns space-ui.bem
"Add modifiers to CSS classes as in BEM method.
See rationale here: http://getbem.com/naming/
For BEM with elements see: https://github.com/druids/ccn
Compared to CCN this gist supports maps."
(:require [clojure.string :as str]))
@spacegangster
spacegangster / typography.clj
Created January 28, 2021 10:32
Simple Clojure typography transformations for English, French, and Russian typography styles.
(ns common.typography
"Improve quotes and make whitespace non-breaking after 1-2 letter words"
(:require [clojure.string :as str]))
(def typo-replace-starting-nbsp
[#"(^[a-zA-Z\u0400-\u0500]{1,2})\ ", "$1 "])
(assert (= "A&nbsp;being in Australia <a class='yoy'>"
(apply str/replace "A being in Australia <a class='yoy'>" typo-replace-starting-nbsp)))