Skip to content

Instantly share code, notes, and snippets.

@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@virullius
virullius / transfer_mysql_db.sh
Created August 27, 2014 21:29
Copy and rename MySQL database
#!/usr/bin/env bash
# transfer mysql database to different server with a new name
# such as production database to test database
read -p "source host:" SRC_HOST
read -p "user for host $SRC_HOST:" SRC_USER
read -p "password for $SRC_USER@$SRC_HOST:" -s SRC_PW; echo
read -p "source database name:" SRC_DB
read -p "target host:" TGT_HOST
@quchie
quchie / Send Email.groovy
Last active November 27, 2022 23:19
Send email using groovy script
import javax.mail.*
import javax.mail.internet.*
/*
Get Any JAVAMAIL Dependency
===============================
Download JAVAMAIL dependency that you need.
download JAVAMAIL at : https://maven.java.net/content/repositories/releases/com/sun/mail/javax.mail/1.5.2/javax.mail-1.5.2.jar
To install, copy & paste the *.jar to installed Groovy lib directory:
eg: C:\Program Files (x86)\Groovy\Groovy-2.1.1\lib
@kingbin
kingbin / gist:9435292
Last active May 4, 2024 12:17
Manually Start/Stop PostgresSQL on Mac
# Stop PostgreSQL from auto starting
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist
# Enable PostgreSQL to auto start
sudo launchctl load -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist
# Start postgres
$ sudo su postgres
Password:
bash-3.2$ pg_ctl -D /Library/PostgreSQL/9.3/data/ start
@virullius
virullius / randomtip.sh
Last active December 21, 2015 20:10
BSD compatible random tool tip based on a Linux version from I-don't-know-where. Append to ~/.bashrc
echo "Did you know that:"; whatis $(ls -1 /bin | head -$(echo "$RANDOM % `ls -1 /bin | wc -l`" | bc) | tail -1)
@a1phanumeric
a1phanumeric / gist:5346170
Created April 9, 2013 14:35
Grep exclusions. Demonstrates how to exclude multiple directories, and files.
grep -r --color --exclude-dir={custom,lib,scripts} --exclude={*.xml,error_log} "beta" .
@yoshimov
yoshimov / WakeOnLan.groovy
Created November 27, 2008 04:51
Send Wake On LAN Magic Packet from Groovy script
// Send Wake On LAN Magic Packet
def int PORT = 9
def cli = new CliBuilder()
cli.h(longOpt: 'help', 'usage information')
cli.i(argName: 'networkInterface', longOpt: 'interface', args: 1, required: true, 'MAC address of network interface(IPv4)')
cli.b(argName: 'broadcast', longOpt: 'broadcast', args: 1, required: true, 'Broadcast address')
def opt = cli.parse(args)