Skip to content

Instantly share code, notes, and snippets.

@maoizm
maoizm / boxstarter-short.ps1
Last active April 23, 2020 06:00
boxstarter script to deploy new Windows 10 pc
# Run: START http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/maoizm/7d0192e9b9493dcd503449fa6a389b49/raw/4a7470fe1b0a81c8b78d7d42150d55c303f826bb/boxstarter.ps1
# or: START http://boxstarter.org/package/nr/url?c:\install\boxstarter.ps1
#
# @TODO add lib_environment.ps1
Set-ExecutionPolicy RemoteSigned
# ENable Group Policy for Powershell
$_urlBase = 'https://raw.githubusercontent.com/TurboBasic/.dotfiles/master/windows/GroupPolicy/'
@maoizm
maoizm / set_environment.ps1
Last active March 6, 2017 03:39
sets environment variables for Machine and User
#
# Initializes Environment variables both globally and for current user session
#
# for login sessions run via
#
# powershell --file ./set_environment.ps1
#
function set_env ($name, $text, $scope="User") {
(getRegistryKey $scope).SetValue($name, $text, [Microsoft.Win32.RegistryValueKind]::ExpandString)
@maoizm
maoizm / solarized-dark.reg
Last active February 8, 2017 01:56
solarized-dark theme for Windows console: regedit /s solarized-dark.reg
Windows Registry Editor Version 5.00
; Registry file that maps the solarized palette to the 16 avaliable colors
; in a Windows command prompt. Note, hex values in the table are RGB but byte
; ordering of a DWORD is BGR, e.g. "ColorTable<##>"=dword:00<B><G><R>
;
; Solarized color table from http://ethanschoonover.com/solarized.
;
; NR cmd.exe PowerShell SOLARIZED HEX DWORD
; -- ------- ----------- --------- ------- --------
@maoizm
maoizm / InnerShadow-SVGFilter.xml
Last active November 10, 2016 18:55
Inner shadow SVG Filter for Illustrator CC 2014. Step 1: Effects > Document Raster Effect Settings... > Resolution: 300+ dpi; Anti-alias: ON, Preserve spot colors: ON, Step 2: Effects > SVG Filters > Apply SVG Filter > New (file icon) > Paste in the Gist & Save, Step 3: Select your object > Effect > SVG Filters > "InnerShadow" (Original source: h…
<filter id="InnerShadow">
<!-- Shadow Offset, don't make vals lower or you'll break it -->
<feOffset
dx='2'
dy='3'
/>
<!-- Shadow Blur -->
<feGaussianBlur
stdDeviation='1'
result='offset-blur'
@maoizm
maoizm / SVG_template.svg
Last active October 31, 2016 07:46
SVG header and template recommended by MDL
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maoizm
maoizm / restore_database.sh
Created September 30, 2016 14:45
Restores mysql database from sql dump
#!/bin/bash
gunzip < $1 | mysql -uпользователь -pпароль --database=имяБазыДанных
@maoizm
maoizm / backup_database.sh
Last active September 30, 2016 14:56
Backs up Joomla database with correct SQL commands to restore on live system without rights to DROP tables and databases
#!/bin/bash
mysqldump -hHost -PportOfMYSQLserver -uUserName -pPassword DatabaseName --no-create-db --skip-add-drop-table | sed -r -e "s/CREATE TABLE (`[^`]+`)/CREATE TABLE IF NOT EXISTS \1/g" -e "s/LOCK TABLES (`[^`]+`)/DELETE FROM \1;\nLOCK TABLES \1/g" | gzip > "$(date +%Y%m%d_%H%M%S)_backup.sql.gz"
@maoizm
maoizm / .minttyrc
Created August 12, 2016 11:11
settings for Babun terminal
Font=InputMono Light
ForegroundColour=131,148,150
BackgroundColour=40,40,40
CursorColour=220,50,47
Black=7,54,66
BoldBlack=0,43,54
Red=220,50,47
BoldRed=203,75,22
Green=133,153,0
BoldGreen=88,110,117
@maoizm
maoizm / babun-post-install
Last active August 12, 2016 11:31
customizing Babun environment
#!/bin/zsh
# curl https://gist.github.com/maoizm/dd11b34049be5a328865b2be92ec93d0/raw/babun-post-install | zsh
#
# based on script of @prabirshrestha at https://gist.github.com/prabirshrestha/279d8b179d9353fe8694
successfully() {
$* || (echo "\nfailed" 1>&2 && exit 1)
}
@maoizm
maoizm / TODO1.md
Created March 31, 2016 16:17
todo list

Todo list

  • premailer installation and config script
  • [x]
  • normal formatting, @mentions, #1234 refs