Skip to content

Instantly share code, notes, and snippets.

@kossoy
kossoy / fixperm.sh
Created January 28, 2016 11:36
Fixing permissions downloaded files for Mac OS X
#!/usr/bin/env
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
# Apple metadata removal
xattr -dr com.apple.quarantine .
@kossoy
kossoy / htop_install.sh
Created October 12, 2015 08:53
htop on Mac OS X
curl -O http://themainframe.ca/wp-content/uploads/2011/06/htop.zip
unzip htop.zip
sudo mv htop /bin
rm htop.zip
@kossoy
kossoy / filter.sh
Created August 13, 2013 04:29
Filter identical files (Mac OS X)
find . -type f -print0 \
| xargs -0 md5 \
| rev \
| sort -t \) -k1,1 -u \
| rev \
| sed -e "s/.*(\(.*\)).*/\"\1\"/"\
| xargs -J % mv % ../cleaned
@kossoy
kossoy / index.html
Created October 3, 2012 17:11
Sticky header and footer with scrollable content
<!DOCTYPE html>
<meta charset="utf-8">
<style>
* {
font-family: Arial, sans-serif;
font-size: 1em;
}
body, html {
@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) {}
@kossoy
kossoy / Readme.md
Created August 26, 2012 02:44
Webkit 100% box

Webkit centered 100% box

@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 / 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 / curl-install.sh
Created May 18, 2012 09:18
install curl
sudo apt-get install curl
@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] : ".";