Skip to content

Instantly share code, notes, and snippets.

on run {input, parameters}
set phrase to input as string
set phrase to quoted form of phrase
set ui_lang to "ru"
set from_lang to "auto"
set to_lang to "ru"
do shell script "open 'https://translate.google.com/?hl='" & ui_lang & "'&sl='" & from_lang & "'&tl='" & to_lang & "'&text='" & phrase
end run
// On PhpStorm, when ussing with laravel mix, for Alias path resolving in components you have to:
// - create a webpack.config.js file separately like:
const path = require('path')
const webpack = require('webpack')
module.exports = {
...
resolve: {
extensions: ['.js', '.json', '.vue'],
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
// 1. Visit a news website like cnn.com
// 2. paste this into your console
setInterval(() =>
document.querySelectorAll('p,img,a,button,h1,h2,h3,span')
.forEach(x=>x.style=`transform:rotate(${Math.random()*777}deg) scale(${Math.random()* 3}); transition:all .5s`)
, 500);
// 3. feel a lil bit better 😘
@lineharo
lineharo / header.pug
Created December 26, 2016 19:46
PUG - auto version .css or another files in HTML head
- function pDate() {
- return new Date().getTime();
- }
doctype html
html(lang="ru")
head
meta(charset="utf-8")
title TITLE
@zetrider
zetrider / TimeWeb - SSH RSA Key
Created November 19, 2015 12:29
Авторизация SSH по RSA ключу - TimeWeb
user - имя пользователя
server.timeweb.ru - сервер
1. На машине ssh-keygen -t rsa
2. Копируем, можно по FTP или одной из команд
2.1. ssh-copy-id -i ~/.ssh/id_rsa user@server.timeweb.ru
2.2. scp ~/.ssh/id_rsa.pub user@server.timeweb.ru:~
3. На сервере
[ -d ~/.ssh ] || (mkdir ~/.ssh; chmod 711 ~/.ssh) # создание директории и изменение прав
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys # добавление открытого ключа
@software-mariodiana
software-mariodiana / datepicker-focus.js
Created December 12, 2014 14:19 — forked from sinelaw/datepicker-focus.js
Fix IE bug for datepicker reopening. (I am not sure if this works on modern IE versions.)
/**********************************************************
* Hack to fix datepicker issue in IE.
*
* https://gist.github.com/sinelaw/5416130
**********************************************************
*
* After jquery ui datepicker selection, blur and change
* events fire before focus is returned to the input field,
* handling a quirk from IE browsers
*/
@natritmeyer
natritmeyer / mount_smbfs.sh
Created September 19, 2013 09:40
How to mount and unmount a SMB share on Mac OS X (using mount_smbfs)
#Mounting the share is a 2 stage process:
# 1. Create a directory that will be the mount point
# 2. Mount the share to that directory
#Create the mount point:
mkdir share_name
#Mount the share:
mount_smbfs //username:password@server.name/share_name share_name/