This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby1.9.1 | |
# coding: utf-8 | |
if ARGV.empty? | |
STDERR.puts "Usage: fajrant hours" | |
exit(-1) | |
end | |
begin | |
hours = Integer(ARGV[0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby1.9.1 | |
# encoding: utf-8 | |
require 'rubygems' | |
require 'nokogiri' | |
require 'mechanize' | |
def get_password | |
puts "Password please:" | |
system "stty -echo" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global alias.suck pull | |
git remote add my url | |
git branch dick | |
`git suck my dick` command (almost) ready to use! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="search" data-range="1" data-offset="5"> | |
<div class="wrapper"> | |
<label> | |
First date: | |
<input type="text" value="" class="calendar first" readonly="readonly" /> | |
</label> | |
<input type="hidden" value="" name="day" data-type="day" /> | |
<input type="hidden" value="" name="month_1" data-type="month" /> | |
</div> | |
<div class="wrapper"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Earthquake.init do | |
command :o do |m| | |
begin | |
tweet = twitter.status(m[1]) | |
browse "https://twitter.com/#{tweet['user']['screen_name']}/status/#{m[1]}" | |
rescue | |
puts 'invalid input' | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
Earthquake.init do | |
output do |item| | |
if item["_stream"] && item["text"] | |
notify item["text"], title: "#{item["user"]["name"]} (#{item["user"]["screen_name"]})" | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php | |
$('[placeholder]').focus(function() { | |
var input = $(this); | |
if (input.val() == input.attr('placeholder')) { | |
input.val(''); | |
input.removeClass('placeholder'); | |
} | |
}).blur(function() { | |
var input = $(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
branch=$(git rev-parse --symbolic --abbrev-ref $1) | |
if [ $branch == "live" ] | |
then | |
echo | |
echo "**** Pulling changes into live server ****" | |
echo | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Instead of: | |
= link_to 'Fajne', fajny_path, id: 'fajny-url' | |
:javascript | |
$('#fajny-url').on('click', function() { | |
$.ajax('jakis/path', { | |
... | |
}).done(function(data) { | |
$('gdzieś').html(data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PhotosController < ApplicationController | |
before_filter :authenticate_user! | |
def create | |
current_user.photo = params[:file] || params[:qqfile] | |
data = if current_user.save | |
{ | |
:success => true, | |
:photo => { |
OlderNewer