Skip to content

Instantly share code, notes, and snippets.

View NARKOZ's full-sized avatar

Nihad Abbasov NARKOZ

  • Kyiv, Ukraine
View GitHub Profile
@leah
leah / gist:216443
Created October 22, 2009 23:07 — forked from steida/gist:216120
:⌉
=⌉
¦-) as opposed to |
⍥ om nom nom
@shapeshed
shapeshed / flv_convert.sh
Created November 1, 2009 10:21
Batch convert flv files to ogv and mp4 formats
#!/bin/bash
# File: flv_convert.sh
# Description: Converts flv files to ogv and mp4
#
# Copyright 2009 George Ornbo (Shape Shed)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@onewland
onewland / cron-test.js
Created November 18, 2009 03:19
simple cron API for node.js
var cron = require('./cron'), sys = require('sys');
cron.Every((2).seconds(), function() { sys.puts('Working!'); });
@shapeshed
shapeshed / monitor_df.sh
Created November 30, 2009 14:14
Monitors disk usage and sends an email when nearing limit
#!/bin/bash
# File: monitor_df.sh
# Description: Monitors disk usage and sends an email if limit reached
#
# Adapted from http://www.cyberciti.biz/tips/shell-script-to-watch-the-disk-space.html
#
# Copyright 2009 George Ornbo (Shape Shed)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@hiratara
hiratara / gist:271916
Created January 8, 2010 08:23
SHA1 ID of commits and trees. (in Japanese)
# 内容は同じだけど履歴は違うけどブランチ master と two-phases を作る
% git init
Initialized empty Git repository in /private/tmp/myrepo/.git/
% touch ab.txt
% git add ab.txt; git commit -m 'a empty file'
[master (root-commit) 7d9d5ea] a empty file
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 ab.txt
% echo 'A\nB' > ab.txt
# subdomains.rake in /lib/tasks
namespace :subdomains do
desc "adds the necessary hosts to your /etc/hosts file from current subdomains in your application"
task :setup => :environment do
# NOTE: default_hosts is used as a locator for the line to update in /etc/hosts
tmp_file, changed = '/tmp/etc_hosts_copy', false
default_hosts, hosts = %w(blog.local emptyblog.blog.local), []
# find all the subdomains used in your app (push to hosts array) - modify this to suit your app
@wvega
wvega / grupomide-ssh-snippets.sh
Created March 19, 2010 20:40
Create video thumbnails with ffmpeg
# create a thumbnail for a video with ffmpeg
ffmpeg -itsoffset -16 -i video.flv -vcodec mjpeg -vframes 1 -an -f rawvideo -s 142x94 thumbnail.jpg
# ...
video=video.flv; ffmpeg -itsoffset -16 -i $video -vcodec mjpeg -vframes 1 -an -f rawvideo -s 142x94 "`basename $video .flv`.jpg"
# remove last charater from filename of JPG files with filename ending in M
ls *M.jpg | while read line; do echo mv $line `echo $line | sed 's/\(.*\)M.jpg/\1.jpg/'`; done
_________________________________________
/ you really should just stay up and keep \
\ drinking it /
-----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
#!/bin/bash
# File: batch_pngcrush.sh
# Description: Batch processes PNG files using the pngcrush
# http://pmt.sourceforge.net/pngcrush/
#
# Copyright 2010 George Ornbo (Shape Shed)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@jensgro
jensgro / html5forms.html
Created April 28, 2010 13:25
HTML5-Formularelemente
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5 Form Elements</title>
<style>
body { padding:1em; }
</style>
</head>
<body>