Skip to content

Instantly share code, notes, and snippets.

@zechdc
zechdc / Guide.md
Last active November 23, 2015 05:40
Backup Synology Server to Local Ubuntu Server and to Crashplan Online +

How to backup your Synology NAS

Work in progress

I'm not crazy about using the built in Synology backup because it uses a propriatary format when it stores the data. Here is what I'm looking for:

  1. Cheapest backup possible
  2. 1 Remote backup and 1 local backup
  3. SHR-2 (RAID6) so I hopefully never have to use my backups in the first place.
  4. Local backup should be able to expand, automatically fix data rot, and if a hard drive fails, the power supply goes out, the mother board dies, etc, I can easily grab any of the hard drives, plug them in, and be able to access the files on that drive.
@zechdc
zechdc / 0_reuse_code.js
Created September 22, 2016 03:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
function shuffle(deck){
randomNumber(0, 100);
};
function randomNumber(min, max){
//do stuff
}
A--
|--B--
|--C
|--D
throw new Error('WHYYYY');
/**!
* Sortable
* @author RubaXa <trash@rubaxa.org>
* @license MIT
*/
(function sortableModule(factory) {
"use strict";
if (typeof define === "function" && define.amd) {
// Below is the relevant snippets related to sentry
const SentryCliPlugin = require('@sentry/webpack-plugin');
const EnvConfig = require('./env');
// EnvConfig.SENTRY_ENABLED = true;
function initSourceMaps() {
if (EnvConfig.SENTRY_ENABLED) {
return 'source-map';
}
//snippet of our package.json
{
"dependencies": {
"@sentry/browser": "^5.15.4",
"@sentry/integrations": "^5.15.4",
},
"devDependencies": {
"@sentry/webpack-plugin": "^1.10.0",
}
}
@zechdc
zechdc / twilioToTextableAndSlack.js
Created July 25, 2021 15:00
Advanced Twilio Setup Guide for Textable.io - Allow you to use Twilio Functions and Twilio Studio
// https://www.textable.co/docs/twilio-setup-guide/
// Textable setup guide doesn't allow you to use Twilio functions or Studio easily.
// Instead, you can create a twilio function with this code, then use that function
// in Twilio Studio
// Add axios 0.20.0 as a dependency under Functions Global Config, Dependencies
const axios = require('axios');
// Add qs 6.9.4 as a dependency under Functions Global Config, Dependencies
const qs = require('qs');
const crypto = require('crypto');
// Add awesome-phonenumber 2.55 as a dependency under Functions Global Config, Dependencies
@zechdc
zechdc / InputAutosize.tsx
Last active April 17, 2024 15:26
React v18 Autosize Input
// Learn more: https://dev.to/zechdc/autosize-input-field-plain-js-and-react-examples-38kb
import { cn } from "~/lib/shadcnui";
interface InputAutosizeProps
extends React.InputHTMLAttributes<HTMLInputElement> {
value: string;
}
export default function InputAutosize({