Skip to content

Instantly share code, notes, and snippets.

View a-x-'s full-sized avatar
🛩️

Alexander a-x-

🛩️
View GitHub Profile
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

@0xF1o
0xF1o / lobmosq.c
Created September 6, 2016 10:15
libmosquitto example
/*
needs libmosquitto-dev
$ gcc -o libmosq libmosq.c -lmosquitto
*/
#include <stdio.h>
#include <mosquitto.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@a-x-
a-x- / inheritance-demo.cpp
Created August 11, 2016 10:34
Вспомнить наследование в c++ / Компиляция и запуск на маке: `clang -O3 -stdlib=libstdc++ inherit.cpp -o inherit&&./inherit`
// clang -O3 -stdlib=libstdc++ inherit.cpp -o inherit&&./inherit
#include <stdio.h>
#include <stdlib.h>
class iBem {
protected: int setMod(){return 1;};
};
/*
@a-x-
a-x- / ValOp.md
Last active July 30, 2016 16:27
Operations on maybe types transport

https://twitter.com/mxtnr/status/759409328956776448

Родилась интересная концепция, которая лучше всего может заработать в ФП-языках (но применимо и в таких языках как js).

Пример: есть блок popup2 с параметром mainOffset и дефолтным значением 5, если задан параметр theme=normal, иначе 0

И есть блок tooltip, который композируются над popup2.
Если задан параметр блока tooltip tail: false, он увеличивает mainOffset на 5 Но если mainOffset не задан, то tooltip не знает, что делать.

@a-x-
a-x- / bem-tools.spec.md
Last active February 6, 2017 19:31
BEM Tools specification draft
@ericclemmons
ericclemmons / example.md
Last active March 20, 2026 13:00
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@vvgomes
vvgomes / foo.js
Last active August 10, 2021 18:10
Ramda vs Lodash
var _ = require("lodash");
var R = require("ramda");
var companies = [
{ name: "tw", since: 1993 },
{ name: "pucrs", since: 1930 },
{ name: "tw br", since: 2009 }
];
var r1 = _(companies).chain()
@ftiasch
ftiasch / server.py
Created August 13, 2015 09:52
python SimpleHTTPServer with custom MIME types
import SimpleHTTPServer
import SocketServer
PORT = 8000
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
pass
Handler.extensions_map['.shtml'] = 'text/html'
@oshybystyi
oshybystyi / git-auto-status.plugin.zsh
Created June 10, 2015 10:28
OhMyZsh plugin to display git status after a bunch of predefined git commands
#
# Run git status after specified set of command
#
# @author Oleksandr Shybystyi oleksandr.shybystyi@gmail.com
#
# default list of git commands `git status` is running after
gitPreAutoStatusCommands=(
'add'
'rm'
@ramanqul
ramanqul / cyrillic2latin_file_renamer.py
Created March 14, 2015 20:42
Cyrillic to Latin File Changer
#!/usr/bin/python
# -*- coding: utf-8 -*-
from os import walk, rename, unlink, mkdir, remove
from os.path import isdir, exists
from sys import argv, exit, getfilesystemencoding
from shutil import copyfile
import shutil
conversion = {