Skip to content

Instantly share code, notes, and snippets.

View cesarmiquel's full-sized avatar

Cesar Miquel cesarmiquel

View GitHub Profile
@cesarmiquel
cesarmiquel / backup-tumblr-likes.php
Last active March 6, 2019 06:43
A script to backup all your liked images and metadata from Tumblr.
<?php
$date = date('Y-m-d');
if ($argv[1]) {
$date = $argv[1];
}
// Get all posts for this montn posts
$biggest_timestamp = strtotime($date) - 60;
$selected_month = date('Ym', strtotime($date));
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<!-- page content -->
<?php
$e = new \Exception;
var_dump($e->getTraceAsString());
#2 /usr/share/php/PHPUnit/Framework/TestCase.php(626): SeriesHelperTest->setUp()
#3 /usr/share/php/PHPUnit/Framework/TestResult.php(666): PHPUnit_Framework_TestCase->runBare()
#4 /usr/share/php/PHPUnit/Framework/TestCase.php(576): PHPUnit_Framework_TestResult->run(Object(SeriesHelperTest))
#5 /usr/share/php/PHPUnit/Framework/TestSuite.php(757): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult))
#6 /usr/share/php/PHPUnit/Framework/TestSuite.php(733): PHPUnit_Framework_TestSuite->runTest(Object(SeriesHelperTest), Object(PHPUnit_Framework_TestResult))
@cesarmiquel
cesarmiquel / bash-terminal-love.sh
Last active May 24, 2018 11:33
Bash Terminal Love
#!/bin/bash
# Fonts
# https://askubuntu.com/questions/528928/how-to-do-underline-bold-italic-strikethrough-color-background-and-size-i
echo -e '\e[1mbold\e[22m'
echo -e '\e[2mdim\e[22m'
echo -e '\e[3mitalic\e[23m'
echo -e '\e[4munderline\e[24m'
echo -e '\e[4:1mthis is also underline (new in 0.52)\e[4:0m'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cesarmiquel
cesarmiquel / mysql.sh
Created January 16, 2018 20:53
Clliente mysql usando docker
docker run -it --rm mysql mysql -hsome.mysql.host -usome-mysql-user -p
@cesarmiquel
cesarmiquel / stars.py
Last active January 22, 2019 22:58
Get starred repositories for a Github username.
# -*- coding: UTF-8 -*-
import sys
import json
import urllib2
def color(this_color, string):
return "\033[" + this_color + "m" + string + "\033[0m"
@cesarmiquel
cesarmiquel / drupal-8-cheatsheet.md
Last active April 8, 2025 21:15
Drupal 8/9/10 Cheatsheet

Drupal 8/9/10 Cheatsheet

[Update 2024] - Take a look at Drupal at your fingertips. Lot's of great stuff there.

Files, Images and Media

// Load file object
$file = File::load($fid);
@cesarmiquel
cesarmiquel / pm.sh
Created September 22, 2017 21:10
Ubuntu 17.04 worked out of the box, but there was one annoyance: battery life. For some reason, the laptop was using 10 watts at idle. Thanks to some forum posts, I managed to tweak various kernel module options and got idle down to 4 watts. This drastically improved battery life. I then put together a script to enable power savings on startup. …
#!/bin/sh
# Disable the NMI watchdog
echo '0' > '/proc/sys/kernel/nmi_watchdog';
# Runtime power management for I2C devices
for i in /sys/bus/i2c/devices/*/device/power/control ; do
echo auto > ${i}
done
@cesarmiquel
cesarmiquel / test-react.md
Last active July 28, 2017 04:15
Trying out React

Generate an Docker image with Node and Create React App installed. For this edit a file called Dockerfile with the following content:

FROM node:6-alpine

# Install create-react-app
RUN npm install -g create-react-app

WORKDIR /src

CMD [ "node" ]