Skip to content

Instantly share code, notes, and snippets.

View NARKOZ's full-sized avatar

Nihad Abbasov NARKOZ

  • Kyiv, Ukraine
View GitHub Profile
anonymous
anonymous / personwatcher.rb
Created July 28, 2014 21:31
DIY API in Ruby
#!/usr/bin/ruby
require 'rubygems'
require 'net/http'
require 'io/console'
require 'json'
puts "Welcome to the DIY Person Watcher."
puts "Put an empty string as the User's URL to exit."
puts
@weppos
weppos / title_helper.rb
Created August 3, 2008 20:46
Provides helpers for managing page title.
#
# = Rails Title Helper
#
# Provides helpers for managing page title.
#
# Category:: Rails
# Package:: Helpers
# Author:: Simone Carletti <weppos@weppos.net>
# Copyright:: 2007-2008 The Authors
# License:: MIT License
@shapeshed
shapeshed / clean_filenames.sh
Created February 3, 2009 13:49
Bash script to convert all filename in a folder to lowercase and replace spaces with underscores
#!/bin/bash
# Replaces spaces in filenames with underscores and converts filenames to lowercase
# Run within a directory to convert all files
ls | while read -r FILE
do
mv -v "$FILE" `echo $FILE | tr ' ' '_' | tr -d '[{}(),\!]' | tr -d "\'" | tr '[A-Z]' '[a-z]' | sed 's/_-_/_/g'`
done
@IntendedConsequence
IntendedConsequence / MyAnimeList.js
Created May 30, 2009 04:07 — forked from aoikishu/MyAnimeList
A Firefox Ubiquity Parser 2 compatible version of MyAnimeList.net anime and character search command
// anime and character searches for MyAnimeList.net
// An advanced search command for MyAnimeList.net
CmdUtils.CreateCommand({
names: [ "mal-search", "anime-search" ], //mal as in MyAnimeList.net 8)
author: { name: "aoikishu"},
contributors: [ "Irwin1138" ],
description: "Searches anime on MyAnimeList.net",
help: "You can specify a type (ova, tv, movie, special or ona) and a score",
/// Parser 2 incompatible old format
Hi, my name is Ma. Reina S. (29826). How may I help you? [12:26:30 PM]
Woody Gilk: Hello [12:26:40 PM]
Woody Gilk: I have a Linksys WET54G and i am trying to upgrade the firmware [12:26:51 PM]
Ma. Reina S. (29826): Hello, Woody! [12:27:31 PM]
Ma. Reina S. (29826): Before we proceed, may I ask which country you are located? [12:27:32 PM]
Woody Gilk: USA [12:27:07 PM]
Ma. Reina S. (29826): Please look underneath the device itself and get the Version number and the Serial Number (SN) of the WET54G. I need to verify that. [12:28:02 PM]
Woody Gilk: no version number [12:27:50 PM]
Woody Gilk: serial number is bdy003802478 [12:28:11 PM]
Ma. Reina S. (29826): Okay, it's version 1. Please hold on. [12:29:00 PM]
@2bj
2bj / whoiskg
Created July 7, 2009 15:48
bash implementation of http://www.domain.kg/whois.html
#!/bin/bash
# bash implementation of http://www.domain.kg/whois.html
# @author 2bj (gml2bj gmail)
if [ $# -eq 0 ]; then
echo "pls, give me domain (*.kg)"
exit 1
fi
DOMAIN=`echo $1 | tr '[:lower:]' '[:upper:]'`
# Controller for the LostInAspen leaf.
require 'cgi'
require 'facets/random'
class Controller < Autumn::Leaf
MESSAGES = {
/THE RULES/ =>
" ~ The Memory Management Rules everyone should know are at: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html",
@alkema
alkema / seed.rake
Created August 17, 2009 04:37
rails 3 rake db:seed for now
namespace :db do
desc 'Drops and recreates the database from db/schema.rb for the current environment and loads the seeds.'
task :reset => [ 'db:drop', 'db:setup' ]
desc 'Create the database, load the schema, and initialize with the seed data'
task :setup => [ 'db:create', 'db:schema:load', 'db:seed' ]
desc 'Load the seed data from db/seeds.rb'
task :seed => :environment do
seed_file = File.join(Rails.root, 'db', 'seeds.rb')
<a href="http://www.google.com/" class="target-blank">Google</a>
<script type="text/javascript">
$j(document).ready(function() {
$j('a.target-blank').click(function() {
this.target = '_blank';
});
}
</script>
require 'ipaddr'
module Rack
#
# BanHammer is a Rack middleware app that restricts access to your server
# using a black-list of IPv4/IPv6 addresses and ranges.
#
# MIT License - Hal Brodigan (postmodern.mod3 at gmail.com)
#
# Needlessly modified by Mike Frawley