Skip to content

Instantly share code, notes, and snippets.

View KhanMaytok's full-sized avatar
🎃
Comiendo chaufita

KhalO KhanMaytok

🎃
Comiendo chaufita
View GitHub Profile
import requests
import sqlite3 as lite
import xml.etree.ElementTree as ET
r = requests.get("https://s130-es.ogame.gameforge.com/api/highscore.xml?category=1&type=0")
score = r.content
root = ET.fromstring(score)
all_data = []
timestamp = root.attrib['timestamp']
<?php
namespace AppBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Person
*
* @ORM\Table(name="person")
* @ORM\Entity(repositoryClass="AppBundle\Repository\PersonRepository")
*/
{% for ticket in unique_seat_list %}
{% if (loop.index + 3) is divisible by(4) %}
<tr>
{% endif %}
<td>{{ ticket }}</td>
{% if ticket is divisible by(2) and ticket is not divisible by(4) %} <td class="pasillo"> --- </td> {% endif %}
{% if ticket is divisible by(4) %}</tr>{% endif %}
{% endfor %}
galaxy_number = "{}%".format(i)
cur.execute("""SELECT Universe.coords
FROM
Player,
Universe
WHERE
Universe.player = Player.id
AND Universe.coords LIKE ?
AND (
Player.status LIKE '%i'
@KhanMaytok
KhanMaytok / xampp_php7_xdebug.md
Created March 11, 2017 00:37 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP
@KhanMaytok
KhanMaytok / User.php
Created March 3, 2017 23:24 — forked from Ocramius/User.php
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User
@KhanMaytok
KhanMaytok / Savitry.html
Created February 6, 2017 22:01
Theme for tumbler
<!DOCTYPE html>
<!--[if IE 8]><html class="lt-ie10 lt-ie9"> <![endif]-->
<!--[if IE 9]><html class="lt-ie10"> <![endif]-->
<!--[if gt IE 9]><!--> <html> <!--<![endif]-->
<head>
{MobileAppHeaders}
<meta charset="utf-8">
<title>{Title}{block:SearchPage} ({lang:Search results for SearchQuery}){/block:SearchPage}{block:PermalinkPage}{block:PostSummary} — {PostSummary}{/block:PostSummary}{/block:PermalinkPage}</title>
{block:Description}
<meta name="description" content="{MetaDescription}">
@KhanMaytok
KhanMaytok / flatten.js
Created February 1, 2017 04:32 — forked from the-creature/flatten.js
es6 flat array
const flatten = arr => arr.reduce(
(a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []
);
testArr = [[1,2,[3]],4]
console.log(flatten(testArr));
git filter-branch --env-filter -f \
'if [ $GIT_COMMIT = 00c60df755154c1e5652c5ae00c91d53a2260d14 ]
then
export GIT_AUTHOR_DATE="Sun Jan 29 22:38:53 2017 -0800"
export GIT_COMMITTER_DATE="Sun Jan 29 22:38:53 2017 -0800"
fi'
qs_sorted = list()
for skid in list_items:
if skid is not None:
qs_sorted.append(qs.get(id=skid))