Skip to content

Instantly share code, notes, and snippets.

View jnv's full-sized avatar

Jan Vlnas jnv

View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active April 7, 2024 01:38
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@aarongustafson
aarongustafson / TinyMCE-config-HTML5.js
Created August 26, 2010 12:57
Working on a TinyMCE config that supports HTML5
// General
button_tile_map : true,
editor_selector : 'lg_mceEditor',
mode:'textareas',
theme : 'advanced',
// Cleanup/Output
apply_source_formatting : true,
convert_fonts_to_spans : true,
convert_newlines_to_brs : false,
@bver
bver / devise.cs.yml
Created March 27, 2011 20:05
Czech translation for Devise
#
# Czech translation for Devise - config/locales/devise.cz.yml
# 'cs' locale by https://github.com/bver
# Feel free to correct my translation.
#
# Note: devise.failure.invalid was intentionally changed from "email" to "identity" -
# - not all configurations use config.authentication_keys = [ :email ]
#
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
@starenka
starenka / copywriter.py
Created June 1, 2011 16:46
Become a copywriter w/ NTLK
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# generates text based on sample text
#
# @author: starenka
# @email: 'moc]tod[liamg].T.E[0aknerats'[::-1]
# @version: 1.0.3
# @since 6/1/11
# @depends nltk, BeautifulSoup
@madrobby
madrobby / freckle_time_test.rb
Created October 25, 2011 15:45
Freckle accepted time formats (in API)
require File.expand_path('../../test_helper', __FILE__)
describe Freckle::Time do
it "should parse hh:mm" do
assert_equal 15, Freckle::Time.parse(':15')
assert_equal 15, Freckle::Time.parse('0:15')
assert_equal 60, Freckle::Time.parse('1:00')
assert_equal 60, Freckle::Time.parse('01:00')
assert_equal 660, Freckle::Time.parse('11:00')
assert_equal 150, Freckle::Time.parse('2:30')
@mlitwiniuk
mlitwiniuk / nginx_virtual_host
Created December 14, 2011 22:25 — forked from mrsweaters/nginx_virtual_host
Ruby on Rails server setup on Ubuntu 11.04 with Nginx, Unicorn, Rbenv
upstream example-workers {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a single worker for timing out).
server unix:/tmp/example.co.uk.socket fail_timeout=0;
}
server {
listen 80; # default;
server_name example.co.uk;
root /home/example.co.uk/website/public;
@jrochkind
jrochkind / gist:2161449
Created March 22, 2012 18:40
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@josefslerka
josefslerka / gist:2344144
Created April 9, 2012 15:09
Wordlcloud pro Vodafone
library(tm)
require(wordcloud)
require(RColorBrewer)
# zde je treba vlozit korpus
# mydata.vectors <- character(0)
# mydata.vectors <- c("Dobre dopoledne Mateji,pokud jste pri registraci zvolil Moravskoslezsky kraj, zobrazila se vam v aplikaci informace, ze soutez probehne 30.1. Vcera 31.1. sef gangu navstivil Olomoucky a Zlinsky kraj. Zvoleny kraj naleznete v aplikaci v zalozce "Souboj kraju".Kazdopadne dnes hrajeme o 75 telefonu Samsung GALAXY mini. Online kolo zacina jiz ve 13:00.Drzim palce, Sandra, O2 Guru", mydata.vectors)
corpus <- Corpus(VectorSource(mydata.vectors))
corpus <- tm_map(corpus, tolower)
corpus <- tm_map(corpus, removePunctuation)
module AfterCommitCallbacks
def self.included(base)
base.send(:extend, ObserverCallbacks) unless base.respond_to?(:define_model_callbacks_for_observers)
[:create, :update, :destroy].each do |action|
base.send(:define_model_callbacks_for_observers, :"commit_on_#{action}", :only => :after)
end
base.send(:attr_accessor, :newly_created)
base.send(:before_validation, AfterCommitCallbacks::Handlers)