Skip to content

Instantly share code, notes, and snippets.

View gelinger777's full-sized avatar

gelinger777 gelinger777

  • gelinger777
  • World
View GitHub Profile
@gelinger777
gelinger777 / xml_split.py
Created June 22, 2017 19:08 — forked from benallard/xml_split.py
Small python script to split huge XML files into parts. It takes one or two parameters. The first is always the huge XML file, and the second the size of the wished chunks in Kb (default to 1Mb) (0 spilt wherever possible) The generated files are called like the original one with an index between the filename and the extension like that: bigxml.…
#!/usr/bin/env python
import os
import xml.parsers.expat
from xml.sax.saxutils import escape
from optparse import OptionParser
from math import log10
# How much data we process at a time
@gelinger777
gelinger777 / gist:e991f473418d7490adb0
Created February 29, 2016 15:57
Change GIT command to SHIT in linux command line
alias shit="git"
#run this command in command line and you can make
shit init # which is equal to git init
shit push origin master
shit pull origin master
and so on... :)
@gelinger777
gelinger777 / gist:c9ad3a293d205801319b
Created February 19, 2016 15:40
Remove the folder from git
git filter-branch --tree-filter 'rm -rf node_modules' --prune-empty HEAD
echo node_modules/ >> .gitignore
git add .gitignore
git commit -m 'Removing node_modules from git history'
git gc
git push origin master --force
<!-- MarketGidComposite Start -->
<div id="MarketGidScriptRootC589741">
<div id="MarketGidPreloadC589741">
<a id="mg_add589741" href="http://usr.marketgid.com/demo/celevie-posetiteli/" target="_blank">
<img src="//cdn.marketgid.com/images/marketgid_add_link.png" style="border:0px">
</a>
<br>
<a href="http://marketgid.com/" target="_blank">Загрузка...
</a>
</div>
@gelinger777
gelinger777 / gist:7062d90c597d4f959bc1
Created June 25, 2015 11:49
Generate Crud Code for all tables in Codeigniter with Grocery Crud
function simple_crud($table_name) {
$this->load->helper('inflector');
$this->load->helper('string');
$tables = $this->db->list_tables();
foreach ($tables as $table) {
$table = str_replace("a3m_", '', $table);
$table = str_replace("qh_", '', $table);
$table = str_replace("ref_", '', $table);
if (($xml = simplexml_load_file('http://www.cba.am/_layouts/rssreader.aspx?rss=280F57B8-763C-4EE4-90E0-8136C13E47DA')) != false) {
$items = $xml->channel->item;
$c1 = $items[0];
$dolar = $c1->title;
$dolar = explode("-", $dolar);
$c2 = $items[9];
$euro = $c2->title;
$euro = explode("-", $euro);