Instantly share code, notes, and snippets.

Daniel Salamon seniorpreacher

  • Codecool
  • Budapest, Hungary
View GitHub Profile
View ncore_thumbnail_preview.js
const setupStyle = () => {
document.querySelector('#main_all').style.margin = 'inherit';
document.querySelector('#main_all').style.width = '100%';
document.querySelector('#main_all .lista_all').style.margin = '0 10px 0 auto';
const style = document.createElement("style");
const sheet = style.sheet;
sheet.insertRule('.cover-img {position: relative; width: 109px; height: 160px; box-shadow: #00000050 0 0 15px; transition: all .8s ease}');
import requests
import sys
import xml.etree.ElementTree as XmlElement
from flask import Flask, Response
if len(sys.argv) == 1:
raise Exception('Provide nCore key as the first argument!')
NCORE_URL = '' + sys.argv[1]
View .bash_aliases
alias ls="ls -hal "
# Fix wifi problem on Ubuntu
alias fixwifi="sudo service network-manager restart && sudo ifconfig wlo1 up"
alias wifix="fixwifi"
# Set screen rotation to normal
alias fixscreen="xrandr -o normal"
# Stop all docker containers that are running
seniorpreacher /
Last active Oct 31, 2016
A short script to find and rename .str (subtitle) files after it's movie or episode file.
import os
import re
import time
def get_part(filename, part):
season ="" + part + "\d{2}", filename.lower())
if season:
season = season.start()
seniorpreacher /
Created Apr 28, 2016
Python - Fibonacci examples
number_count = 30
list = [0, 1]
for i in range(0, number_count - 2):
list.append(list[-1] + list[-2])
for j in list:
print j
seniorpreacher / signature.html
Last active Mar 21, 2018
View signature.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Codecool e-mail signature generator</title>
<link href="" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link href="" rel="stylesheet" integrity="sha384-QqZs0aSOGFan3GWVdP4PyCBp6icaF/4n8Q+wsmZUTiiVIqE4r4tFYcb8Osf+8y45" crossorigin="anonymous">
View myname.js
var x,u=((x)+[]),f=![]+[],c=String.fromCharCode;u[2]+f[1]+u[1]+u[5]+f[4]+f[2]+f[3]+f[1]+f[2]+f[1]+c(u[1].charCodeAt(0)-1)+c(u[1].charCodeAt(0)^1)+u[1]
seniorpreacher / CCNA-solverV5.js
Last active Dec 28, 2015
This is a modified version of my CCNA solver from last year. Since Cisco changed the whole test structure in the new V5.0, I had to change in the methodology of this script. Now it writes the correct answers after the question. You have to specify a chapter number in the last line of the code! There are 2 parameters for the main function: chapte…
View CCNA-solverV5.js
* Hi, this is a little code, that you can run on a Cisco CCNA test and it will answer every question for you.
* Please, learn the lecture!
* I can't garantee anything! If you use this and you fail... Well, it's your falt.
* Cisco used to change a bit in the texts of the questions, so I can't garantee that this code will even work after some weeks, but I hope ;)
* To run it, just simply:
seniorpreacher / updateIndentationFrom2SpaceToTab.sublime-macro
Created Oct 26, 2013
This macro updates the file from 2 SPACE indentation to TAB indentation.
View updateIndentationFrom2SpaceToTab.sublime-macro
"args": {
"setting": "tab_size",
"value": 2
"command": "set_setting"
seniorpreacher / grid.shorthands.scss
Created Jun 1, 2013
This gist contains some shorthands for Foundation 4's grid system. Feel free to expand it ;)
View grid.shorthands.scss
.l1 {@extend .large-1;}
.l2 {@extend .large-2;}
.l3 {@extend .large-3;}
.l4 {@extend .large-4;}
.l5 {@extend .large-5;}
.l6 {@extend .large-6;}
.l7 {@extend .large-7;}
.l8 {@extend .large-8;}
.l9 {@extend .large-9;}