Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

tagplus5 tagplus5

🎯
Focusing
View GitHub Profile
@tagplus5
tagplus5 / onedark.theme
Created Sep 17, 2017 — forked from fluxrad/onedark.theme
A one-dark theme for xfce4-terminal
View onedark.theme
[Scheme]
Name=One Dark
ColorForeground=#ABB2BF
ColorCursor=#ABB2BF
ColorBackground=#282C34
ColorSelection=#3B4451
ColorSelectionUseDefault=FALSE
ColorBold=#B9C0CB
ColorBoldUseDefault=FALSE
ColorPalette=#282C34;#E06C75;#98C379;#E5C07B;#61AFEF;#C678DD;#56B6C2;#ABB2BF;#3E4452;#BE5046;#98C379;#D19A66;#61AFEF;#C678DD;#56B6C2;#5C6370
@tagplus5
tagplus5 / 0_reuse_code.js
Created Mar 31, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tagplus5
tagplus5 / backup-host.sh
Created Mar 26, 2016 — forked from grigory-v/backup-host.sh
Backup with duplicity to yandex.disk
View backup-host.sh
#!/bin/sh
# Duplicity wrapper
#
# add to crontab:
# 0 8 * * * /bin/sh /usr/local/sbin/backup-host.sh
set -e
PASSPHRASE="looooongpassphrase!@#$#^%&"
@tagplus5
tagplus5 / dup-backup.sh
Created Mar 17, 2016 — forked from Silvenga/dup-backup.sh
For daily systemwide encrypted backups of Ubuntu servers to remote host of Google Drive (free 15GB of storage).
View dup-backup.sh
#!/bin/bash
# Place in /usr/share/backup/
# and make executable
# chmod 0744 dup-backup.sh
# install:
# apt-get install duplicity python-gdata python-gobject-2 python-paramiko
## Remeber to change Google drive user name and Google drive folder
## And change Email
# Must run as root for system wide backups
@tagplus5
tagplus5 / imageToText.gs
Created Dec 18, 2015
google apps script image to text ocr
View imageToText.gs
function doGet(request) {
if (request.parameters.url != undefined && request.parameters.url != "") {
var imageBlob = UrlFetchApp.fetch(request.parameters.url).getBlob();
var resource = {
title: imageBlob.getName(),
mimeType: imageBlob.getContentType()
};
var options = {
ocr: true
};
View xmlToJson.js
/**
* Converts an XML string to a JSON object, using logic similar to the
* sunset method Xml.parse().
* @param {string} xml The XML to parse.
* @returns {Object} The parsed XML.
*/
function xmlToJson(xml) {
var doc = XmlService.parse(xml);
var result = {};
var root = doc.getRootElement();
@tagplus5
tagplus5 / json_utf8_encode.php
Created Nov 21, 2014
json encode utf8 cyrillic
View json_utf8_encode.php
function json_fix_cyr($json_str)
{
$cyr_chars = array(
'\u0430' => 'а', '\u0410' => 'А',
'\u0431' => 'б', '\u0411' => 'Б',
'\u0432' => 'в', '\u0412' => 'В',
'\u0433' => 'г', '\u0413' => 'Г',
'\u0434' => 'д', '\u0414' => 'Д',
'\u0435' => 'е', '\u0415' => 'Е',
'\u0451' => 'ё', '\u0401' => 'Ё',