Skip to content

Instantly share code, notes, and snippets.

View DimaMinka's full-sized avatar
💻
CDK Computers - Modern Web Development

Dima Minka DimaMinka

💻
CDK Computers - Modern Web Development
View GitHub Profile
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@bgallagh3r
bgallagh3r / wp.sh
Last active March 24, 2024 03:12
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@manchunlam
manchunlam / .rsyncignore
Created August 15, 2012 17:12
Sample .rsyncignore
.git
**.swp
.bundle
.DS_Store
.rspec
.sass-cache
.rvmrc
db/*.sqlite3
log/*.log
tmp/*
@jareware
jareware / SCSS.md
Last active May 19, 2024 14:03
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@dgmike
dgmike / gist:4962499
Created February 15, 2013 18:56
Regular expression to test phone numbers in Brazil, including the new Sao Paulo cel phones - that needs to have 9 in first non DDD number.
regexTel = /^\(11\) 9\d{4}-\d{4}|\((?:1[2-9]|[2-9]\d)\) [5-9]\d{3}-\d{4}$/
"(11) 93827-5555".match(regexTel) // OK
"(12) 8201-5555".match(regexTel) // OK
"(11) 89201-5555".match(regexTel) // NOT OK
"(12) 99201-5555".match(regexTel) // NOT OK
"(11) 4201-5555".match(regexTel) // NOT OK
<?php
class WP_HTML_Compression {
protected $compress_css = true;
protected $compress_js = true;
protected $info_comment = true;
protected $remove_comments = true;
protected $html;
public function __construct($html) {
if (!empty($html)) {
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active June 8, 2024 10:07
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@jernejcic
jernejcic / .bash_profile
Last active April 1, 2023 02:08
.bash_profile file on Mac OS X
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases.
# Much of this was originally copied from:
# http://natelandau.com/my-mac-osx-bash_profile/
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
@petemcw
petemcw / brew-instructions.sh
Last active March 27, 2024 15:59
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.test domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache