Skip to content

Instantly share code, notes, and snippets.

@selahssea-zz
selahssea-zz / gist:6660675
Created September 22, 2013 14:51
Rails Ruby mysql MAMP Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) (Mysql2::Error)
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
@selahssea-zz
selahssea-zz / .gitignore
Created November 2, 2014 16:35
Cordova .gitignore (iOS and android)
.idea
# Android
native/platforms/android/assets/www
native/platforms/android/ant-build/
native/platforms/android/ant-gen/
native/platforms/android/res/xml/config.xml
# iOS
native/platforms/ios/build/
@selahssea-zz
selahssea-zz / apply-gitignore.sh
Last active August 29, 2015 14:08
Exclude tracked (commited) files after adding to gitignore
#! /bin/bash
git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached
@selahssea-zz
selahssea-zz / square.css
Created December 2, 2014 17:45
Square div pure CSS
.wrapper{
position: relative;
width: 50%;
overflow: hidden;
background: #4679BD;
}
.wrapper:before{
content: "";
display: block;
padding-top: 100%;
@selahssea-zz
selahssea-zz / gruntfile.js
Last active August 29, 2015 14:12
Gulp + Browser-sync
var gulp = require("gulp");
var browserSync = require("browser-sync");
gulp.task('browser-sync', function(){
browserSync.init(["www/css/*.css", "www/js/*.js", "www/*.html"], {
server: {
baseDir: "www"
},
logConnections: true,
ghostMode: false,
@selahssea-zz
selahssea-zz / index.html
Last active August 29, 2015 14:13
Выравнивание блоков по ширине
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
@selahssea-zz
selahssea-zz / image disk
Last active August 29, 2015 14:19
Write disk image in OS X
#find disk
$ diskutil list
#unmount it (check the number)
$ diskutil unmountDisk /dev/disk2
#format it (check the number)
$ sudo dd if=/dev/zero of=/dev/rdisk2 bs=1024 count=1
#write image to it (check .img name and disk number)
scutil --set HostName name-of-host
@selahssea-zz
selahssea-zz / open-chrome.sh
Last active November 20, 2018 13:17
Google Chrome disable web security (CORS) on Mac OS X
#!/bin/bash
open /Applications/Google\ Chrome\ Canary.app/ --args --disable-web-security
@selahssea-zz
selahssea-zz / elcapitan.sh
Created January 21, 2016 08:52
Create bootable OS X El Capitan ISO
#!/bin/bash
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
# Create the ElCapitan Blank ISO Image of 7316mb with a Single Partition - Apple Partition Map
hdiutil create -o /tmp/ElCapitan.cdr -size 7316m -layout SPUD -fs HFS+J
# Mount the ElCapitan Blank ISO Image
hdiutil attach /tmp/ElCapitan.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build