This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION slugify(title VARCHAR) RETURNS varchar AS $$ | |
BEGIN | |
RETURN trim(both '-' from regexp_replace(lower(transliterate(title)), '[^a-z0-9]+', '-', 'g')); | |
END; | |
$$ LANGUAGE plpgsql; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION transliterate(my_text VARCHAR) RETURNS varchar AS $$ | |
DECLARE | |
text_out VARCHAR DEFAULT ''; | |
BEGIN | |
text_out := my_text; | |
text_out := translate(text_out, 'àâäåáăąãā', 'aaaaaaaaa'); | |
text_out := replace(text_out, 'æ', 'ae'); | |
text_out := translate(text_out, 'çċćčĉ', 'ccccc'); | |
text_out := translate(text_out, 'éèėëêēĕ', 'eeeeeee'); | |
text_out := translate(text_out, 'îïìíī', 'iiiii'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You create your bookmarklet by instantiating | |
// a new Bookmarklet function, then pass in the options like so. | |
// This example checks to see if the var is already defined, and makes | |
// sure not to overwrite it. This could happen if the user clicks on | |
// the bookmarklet more than once. | |
MyBookmarklet = MyBookmarklet || (MyBookmarklet = new Bookmarklet({ | |
// debug: true, // use debug to bust the cache on your resources | |
css: ['/my/style.css'], | |
js: [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx React.DOM */ | |
var React = require('react'), | |
Router = require('react-router'), | |
Route = Router.Route, | |
Routes = Router.Routes, | |
Link = Router.Link, | |
App = require('./components/App.jsx'), | |
Dashboard = require('./components/Dashboard.jsx'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//AUTOCOMPLETE TABLE | |
var table_data = []; | |
var last_search = null; | |
var timers = []; | |
// NOTE: iOS and Android keys will be different! | |
var IOS_API_KEY = 'xxx__APIKEY___xxx'; | |
var ANDROID_API_KEY = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if swapon -s | grep -q /mnt/swapfile | |
then | |
echo "Swapfile already mounted" | |
else | |
if [ -e /mnt/swapfile ] | |
then | |
echo "Mounting swapfile" | |
swapon /mnt/swapfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Originally appeared on my medium page here: https://medium.com/@unmgmt | |
Thanks for reaching out. | |
I charge $____ USD per day plus travel and expenses for my services. Clients pay on retainer in increments of __ days minimum. | |
Any referrals I make come with a __% finders fee for the first ___ hours billed, or ___% of the gross yearly salary. | |
I am currently on assignment in _____, _____ until _____. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
azure vm show <RG_GROUP> <VM_NAME> |grep "Public IP address" | awk -F ":" '{print $3}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream transmission { | |
server 127.0.0.1:9091; #Transmission | |
} | |
server { | |
listen 443 ssl spdy; | |
server_name example.com; | |
auth_basic "Server Restricted"; | |
auth_basic_user_file /var/www/myWebSite/web/.htpasswd; | |
# Path to the root of your installation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# all credit goes to: https://www.dgsec.net/transmission-web-over-https-with-nginx/ | |
server { | |
listen 443 ssl; | |
listen [::]:443 ssl ; | |
server_name torrent.YOURDOMAIN.NET; | |
ssl_certificate ssl/YOURCERT.crt; | |
ssl_certificate_key ssl/YOURCERT.pem; |
OlderNewer