Skip to content

Instantly share code, notes, and snippets.

Avatar

Timoschenko Viacheslau ch3ll0v3k

View GitHub Profile
@ch3ll0v3k
ch3ll0v3k / autobuild.py
Created Mar 14, 2016 — forked from aponxi/autobuild.py
Sublime Text 2 Plugin Examples
View autobuild.py
#https://github.com/a-sk/sublime-build-on-save/blob/master/autobuild.py
from os.path import splitext, basename, dirname, join
import sublime_plugin
class AutoBuild(sublime_plugin.EventListener):
def on_post_save(self, view):
file_path = view.file_name()
working_dir = dirname(file_path)
file_name, file_type = splitext(basename(file_path))
@ch3ll0v3k
ch3ll0v3k / console.js
Created Mar 14, 2016 — forked from aponxi/console.js
Console Take Over
View console.js
function cnsl(){
var console = window.console
if (!console) return
function intercept(method){
var original = console[method]
console[method] = function(){
// do sneaky stuff
if (original.apply){
// Do this for normal browsers
original.apply(console, arguments)
View sample_022.py
class FilesWork(object):
def __init__(self, arg):
# -------------------------------------------------------------
if len(sys.argv) == 1:
print "For compile new file enter: bcg.py [filename.mb]"
exit();
# выходим, так-как нету файла
@ch3ll0v3k
ch3ll0v3k / Makefile
Created Aug 30, 2016 — forked from nzjrs/Makefile
Python ctypes example
View Makefile
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
@ch3ll0v3k
ch3ll0v3k / gist:b01ec0c96ee0896ba7cb74f453eb59df
Created Sep 30, 2016
Sublime Text 2 - Useful Shortcuts
View gist:b01ec0c96ee0896ba7cb74f453eb59df

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+ insert line after
View tf-pg.js
var R = require('ramda');
void 0; //to not bloat the output
var random = require('seed-random')(1337);
var data = [
{input: [0, 0], output: 0},
{input: [1, 0], output: 1},
{input: [0, 1], output: 1},
{input: [1, 1], output: 0},
];
var activation_sigmoid = x => 1 / (1 + Math.exp(-x));
@ch3ll0v3k
ch3ll0v3k / mail.php
Created Jan 4, 2017 — forked from rantastic/mail.php
PHP: Send email using amazon SES
View mail.php
<?php
//class docs: http://www.orderingdisorder.com/aws/ses/
require_once('ses.php');
//get credentials at http://aws.amazon.com My Account / Console > Security Credentials
$ses = new SimpleEmailService('ACCESSkeyID', 'SECRETaccessKEY');
$m = new SimpleEmailServiceMessage();
View html main frame sample
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Page-Title</title>
<meta charset="utf-8"/>
<style type="text/css">
/* ---------------------------------------------------------------------- */
View server.js
var express = require('express');
var io = require('socket.io');
var http = require('http');
var fs = require('fs');
http.createServer(function (request, response) {
console.log('request ' + request.url);
View .gitignore
echo-server-epoll
echo-server-poll
talk
talk.dSYM