Skip to content

Instantly share code, notes, and snippets.

View nask0's full-sized avatar
👾
nothing

nask0 nask0

👾
nothing
  • ...somewhere in time!
View GitHub Profile
#!/bin/bash
# vim: set sts=4 sw=4 et tw=0 :
#
# License: BSD
AUTOMAGIC_MODE="false"
: ${XWININFO:=$(type -P xwininfo)}
[[ -z ${XWININFO} ]] && { echo "You need to install xwininfo"; exit 1; }
: ${XPROP:=$(type -P xprop)}
@nask0
nask0 / git-loglive
Created October 23, 2013 09:49 — forked from sherman/git-loglive
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all
sleep 1
done
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
@nask0
nask0 / aescrypt.py
Created October 8, 2015 06:59 — forked from SpotlightKid/aescrypt.py
Encrypt/decrypt files with symmetric AES cipher-block chaining (CBC) mode.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Encrypt/decrypt files with symmetric AES cipher-block chaining (CBC) mode.
Usage:
File Encryption:
aescrypt.py [-f] infile [outfile]
var LocHelper = (function() {
var locationHelper = locationHelper || {};
locationHelper.coords = false;
locationHelper.domEl = document.getElementsByTagName("body");
locationHelper.updateDomEl = function( innerHtml ) {
if( 'string' === typeof innerHtml ) {
locationHelper.domEl.innerHTML = innerHtml;
}
@nask0
nask0 / postbank.location.js
Created March 29, 2016 19:29 — forked from miglen/postbank.location.js
postbank.location.js
/*
Този скрипт е пълен с едни от най-забавните коментари на български.
Разработен е от някой от разработчиците на Iliyan.com за Пощенска банка.
Пазя го за да се смеем ако го променят в сайта.
Оригинална локация: https://www.postbank.bg/Applications/Locations/_inc/js/locations.js
*/
@nask0
nask0 / web2csv.py
Created March 29, 2016 19:30 — forked from miglen/web2csv.py
Dead simple {for devs} python crawler (script) for extracting structured data from any website into CSV
#!/bin/env/python
#
# Source: http://blog.webhose.io/2015/08/16/dead-simple-for-devs-python-crawler-script-for-extracting-structured-data-from-any-almost-website-into-csv/
import sys, thread, Queue, re, urllib2, urlparse, time, csv
### Set the site you want to crawl & the patterns of the fields you want to extract ###
siteToCrawl = "http://www.amazon.com/"
fields = {}
fields["Title"] = '<title>(.*?)</title>'
fields["Rating"] = 'title="(S+) out of 5 stars"'
class Api extends PhalconApplication
{
/* @var \Phalcon\Config\Adapter\Php */
protected $_config;
/* @var array - API endpoints that require no authentication */
protected $_publicEndpoints= [];
/* @var array - API endpoints that require signed Request Id to proceed */
protected $_protectedEndpoints = [];
<?php
namespace CloseContacts\Lib\DataServices;
use Phalcon\Di\InjectionAwareInterface;
class DataServiceFactory implements InjectionAwareInterface
{
/* @var \Phalcon\Di\FactoryDefault - Dependency injector instance */
protected $_di;
<?php
namespace CloseContacts\Lib\DataServices;
use \Phalcon\Mvc\Model\Manager as ModelsManager;
use \Phalcon\Mvc\Model\Transaction\Failed as TxFailed;
use \Phalcon\Mvc\Model\Transaction\Manager as TxManager;
use \CloseContacts\Lib\Application\Services\Validation;
use \CloseContacts\Lib\Utilities\Date;