Skip to content

Instantly share code, notes, and snippets.

@kossoy
kossoy / sshgit.sh
Created August 26, 2011 05:57
SSH + git quick cheatsheet for Mac
cd ~/.ssh
ssh-keygen -t rsa -C "my.email@domain.com"
cat ~/.ssh/id_rsa.pub | pbcopy
# scp somewhere or paste to github keys
git config --global user.name "name"
git config --global user.email email@m.com
# may be proxy
@kossoy
kossoy / 1 Install nginx.sh
Created August 30, 2011 12:14
Nginx on Mac OS X
#!/usr/bin/env bash
PCRE_DIR="pcre-8.12"
PCRE_LINK="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/$PCRE_DIR.tar.gz"
NGNIX_DIR="nginx-0.8.54"
NGNIX_LINK="http://nginx.org/download/$NGNIX_DIR.tar.gz"
## DOWNLOADS
curl -OL h $PCRE_LINK > $PCRE_DIR.tar.gz
@kossoy
kossoy / dumper.phtml
Created October 4, 2011 14:35
Dummy file dumper
<?php
header('Content-Type: text/html; charset=UTF-8');
# Folder-DB no in web root
define('DB_FOLDER', dirname(__FILE__) . '/../svalka/');
if (isset($_REQUEST['submit'])) {
// Handle the form submit
if('' == $_REQUEST['file-name']) die('Empty filename');
file_put_contents(
@kossoy
kossoy / whatsize.sh
Last active February 26, 2016 17:18
WhatSize in shell
#!/usr/bin/env bash
# Thanks to bolk http://bolknote.ru/2011/09/14/~3407#07
function PrintBar {
if [[ $TERM =~ 256 || $TERM_PROGRAM = "iTerm.app" ]]; then
local colors=("38;5;34" "38;5;220" "38;5;160")
else
local colors=(32 33 31)
fi
@kossoy
kossoy / ListFiles.java
Created May 18, 2012 05:49
Get second column from files in directory and write to csv
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class ListFiles {
public static void main(String[] args) throws IOException {
String path = (args.length > 0) ? args[0] : ".";
@kossoy
kossoy / curl-install.sh
Created May 18, 2012 09:18
install curl
sudo apt-get install curl
@kossoy
kossoy / launchers.sh
Created July 12, 2012 06:41
Launchers
#!/usr/bin/env bash
# ~/Library/LaunchAgents Per-user agents provided by the user.
# /Library/LaunchAgents Per-user agents provided by the administrator.
# /Library/LaunchDaemons System-wide daemons provided by the administrator.
# /System/Library/LaunchAgents Per-user agents provided by Mac OS X.
# /System/Library/LaunchDaemons System-wide daemons provided by Mac OS X.
rm -rf /tmp/launchers.tmp.txt
@kossoy
kossoy / test.html
Created August 26, 2012 02:43
Html test
<!doctype html>
<html>
<head>
<title>Test</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<style type="text/css" media="screen">
body,html{
margin: 0;
@kossoy
kossoy / Readme.md
Created August 26, 2012 02:44
Webkit 100% box

Webkit centered 100% box

@kossoy
kossoy / Readme.md
Created September 6, 2012 06:39
Media queries example

Media queries in action

Simple example using media queries for dynamic size changing of nested divs.

To see results -- open in new window and try to resize.

@media screen and (max-width: 700px) {}