Skip to content

Instantly share code, notes, and snippets.

abrahamcalf / crown.edited.svg
Last active July 12, 2022 08:45
Colored Font Awesome Icon on READMEs
View crown.edited.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View col_versions.R
# 2017 monthly
x <- tempfile("col")
download.file("", file.path(x, ""))
unzip(file.path(x, ""), exdir = x)
taxa <- readr::read_tsv(file.path(x, "taxa.txt"), guess_max=1e6, quote="", col_types = readr::cols(.default = "c"))
taxa %>% filter(specificEpithet == "sapiens", taxonomicStatus == "accepted name", genus=="Homo")
guss77 / Makefile
Created September 22, 2020 20:57
MariaDB update table with UUID
View Makefile
COMPOSE := docker-compose -p demouuid
$(COMPOSE) up -d
sleep 3
while $(COMPOSE) ps | grep -q database; do \
$(COMPOSE) logs 2>/dev/null| grep -q 'MySQL init process done.' && break;\
$(COMPOSE) logs 2>/dev/null| grep -i error && break;\
$(COMPOSE) ps | grep -q Exit && break;\
from docx import Document
from docx.shared import Cm, Pt
article_1 = """Bayern Munich came out on top in a thrilling German Cup final, beating Bayer Leverkusen 4-2 to secure its 20th title and remain on course for an historic treble.
David Alaba's stunning free kick and Serge Gnabry's clinical finish gave Bayern a commanding lead heading into half time and Hans-Dieter Flick's side seemingly already had one hand on the trophy.
However, Leverkusen responded well early in the second half and had a golden opportunity to halve the deficit through substitute Kevin Volland."""
article_2 = """(CNN)Liverpool got its Premier League title-winning celebrations back on track with a 2-0 win over Aston Villa, just days after being on the receiving end of a record-equaling defeat.
Many had suggested Jurgen Klopp's side was suffering from something of a hangover during Thursday's 4-0 demolition at the hands of Manchester City -- the joint-heaviest defeat by a team already crowned Premier League champion -- but Liverpool re
phpfiddle / fiddle_053877.php
Created September 18, 2019 15:24
[ Posted by Expangea ] PHP preg_match_all xml tags
View fiddle_053877.php
$text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. <code>Donec sed erat</code> vel diam ultricies commodo.
Nunc venenatis tellus eu quam suscipit quis fermentum <code>dolor vehicula.</code> fin";
$regex = '#<\s*?code\b[^>]*>(.*?)</code\b[^>]*>#s';
$code = preg_match_all($regex, $text, $matches);
echo $text."<hr>";
echo var_export($matches,true);
joshcangit / folder-import.php
Last active October 4, 2022 16:28
Import .sql database files from a folder into Adminer.
View folder-import.php
* Import SQL files from a directory
* @author joshcangit,
* @author Roy-Orbison,
class AdminerImportFromFolder {
Jiab77 /
Last active March 8, 2023 14:16
Migrate from PHP to Python

Migrate from PHP to Python

Hi all, recently I've decided to move on and learn Python programming. At first, I though that it would be very difficult but in fact... Not that much. So I've decided to write this little gist and show the main differences between both languages.

I will use try to follow the same order used on this website: It was really usefull to improve my understanding of Python programming.

To finish, I'm assuming that you already got basic knowledge in Object Oriented Programming and already got skills and understanding of PHP programming. This is not intended to explain you how to code in PHP but if you're coming from Python programming, then this gist might help you to migrate from Python to PHP.

Official documentations

tommyready /
Created October 16, 2017 17:49
Using Python to dump a Mysql database and import into another Mysql database
#!/usr/bin/env python
import ConfigParser
import os
import time
import getpass
def combine_files(self,file1,file2):
with open('file1', 'w') as outfile:
with open(file2) as infile:
trafficinc /
Last active February 15, 2023 20:45
Python script for taking mysqldump
Will backup all the databases listed, will put files in same DIR as script'
To run: $ python OR python3
import configparser
import os
import time
rodmcnew / iframe-killa.js
Last active March 2, 2022 23:07
This is a bookmarklet that removes all iframes from the current page. Paste its code into a bookmark URL field. Click the bookmark to remove all iframes. Once started, it also removes newly spawned iframes every 100ms.
View iframe-killa.js
javascript:void(function(){setInterval(function(){document.querySelectorAll('iframe').forEach(function(element){console.log('Iframe Killa - Removing Element:', element);element.parentNode.removeChild(element)})},100)}());