Skip to content

Instantly share code, notes, and snippets.

@Erliz
Erliz / lab2.hs
Created November 18, 2015 22:54
FP101x Introduction to Functional Programming
module Lab2 where
------------------------------------------------------------------------------------------------------------------------------
-- Lab 2: Validating Credit Card Numbers
------------------------------------------------------------------------------------------------------------------------------
-- ===================================
-- Ex. 0
-- ===================================
@Erliz
Erliz / miha-news.py
Last active November 10, 2015 12:28
Slack news sender from yandex main page
from lxml import html
import os.path
import requests
import json
if os.path.isfile("settings.py"):
from settings import *
else:
webHookData = {
"text": "test",
@Erliz
Erliz / cr2-remover.bat
Last active November 9, 2015 21:46
Remove .CR2 files w/o .jpg file near
@echo off
REM Move to "deleted" directory .CR2 files w/o .jpg file placed near in current directory
setlocal enabledelayedexpansion
set workDir=
set rawExtension=.CR2
set jpgExtension=.jpg
set filesToRemove=
echo Looking for "*!rawExtension!" w/o "*!jpgExtension!" in current directory
#s = 'awmorbob5bobcoahvyepoeiaciie'
#s = 'tkobookmwbobooboboofoboboobuobobsipbu'
#s = 'azbcbobobegghakl'
#s = 'xwxmhdcowiqzpfodumm'
s = 'abcdefghijklmnopqrstuvwxyz'
alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
currentString = longestString = ''
currentCharKey = 0
previewCharKey = 0
Xvfb +extension RANDR :1 -screen 0 1920x1080x24 &
java -jar selenium-server-standalone-2.42.2.jar &
php -c /usr/local/etc/php.ini console.php -a M_SeleniumSender:send
@Erliz
Erliz / gist:6715470
Created September 26, 2013 15:05
User-Agents
/**
* Set browser, OS, version to curl user agent
*/
private function setUserAgent()
{
$list=Array(
0=>Array(
array('title'=>"Chrome 4.0.249.0 (Win 7)","value"=>"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5"),
array('title'=>"Chrome 5.0.310.0 (Server 2003)","value"=>"Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9"),
array('title'=>"Chrome 7.0.514.0 (Win XP)","value"=>"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.514.0 Safari/534.7"),
@Erliz
Erliz / gist:6674176
Last active December 23, 2015 18:09
Combat-m question selector
$('#ctl00_ContentPlaceHolder1_LearningProductContainer').append(
$('<input id="clipboard" value="" /><button id="clipper">clipper</button>')
);
$('#clipper').click(function(event){
event.preventDefault();
var input = $('#clipboard');
input.val($('.QuestionText').text().trim());
input.select();
});
@Erliz
Erliz / gist:6231477
Last active December 21, 2015 01:59
Shell conf
PS1="[\033[32m\u\033[37m@\033[32m\h \033[33m\W\033[00m]\$ "; export PS1
alias ll='ls -laG'
bind '"\e[1~": beginning-of-line'
bind '"\e[4~": end-of-line'
bind '"\e[3~": delete-char'
bind '"\e[5~": history-search-backward'
bind '"\e[6~": history-search-forward'
<?php
/**
*
*/
class M_File
{
private $id;
private $handle;
private $delimiter = ';';
private $encode = 'cp1251';