Skip to content

Instantly share code, notes, and snippets.

View hexode's full-sized avatar

Alexander Verkhoglyad hexode

  • Toloka
  • Belgrade
  • 08:53 (UTC +02:00)
View GitHub Profile
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
#!/bin/bash -e
#
# Author: Werner Beroux <werner@beroux.com>
# Help?
if [[ $# -eq 0 || $1 == --help || $1 == -h ]]
then
echo "inotifyexec version 1.1.0"
echo "Requires inotify-tools."
echo ""
[user]
name = Ton Nom
email = ton@email.tld
[color]
ui = auto
[alias]
st = status
ci = commit
lg = log --graph --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ar)%Creset'
[core]
@hexode
hexode / rAF.js
Created April 29, 2014 15:29 — forked from paulirish/rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@hexode
hexode / regexp_list.md
Last active August 29, 2015 14:00
Regular expression snippets
@hexode
hexode / print_md.sh
Created May 21, 2014 11:08
Print all markdown recursively
# List of printer names
lpstat -p -d
# Print all md recursively
find . -regex '.*\.md' -exec lp -d <printer_name> {} \;
@hexode
hexode / di.js
Last active August 29, 2015 14:02
Dependency Injection
/**
* Constructor DependencyInjector
* @param {Object} - object with dependencies
*/
var DI = function (dependency) {
this.dependency = dependency;
};
// Should return new function with resolved dependencies
DI.prototype.inject = function (func) {
@hexode
hexode / refsed.bash
Created June 4, 2014 08:16
Refactor via sed
git ls-files | xargs sed -i -e 's/old-method-name/new-method-name/g'