Skip to content

Instantly share code, notes, and snippets.

View andreynering's full-sized avatar

Andrey Nering andreynering

View GitHub Profile
@andreynering
andreynering / main.go
Created May 19, 2016 18:10 — forked from manishtpatel/main.go
GoLang Encrypt string to base64 and vice versa using AES encryption.
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
)
@andreynering
andreynering / confirm.go
Created April 13, 2016 17:17 — forked from albrow/confirm.go
Go (golang): How to ask for user confirmation via command line
import (
"fmt"
"log"
"os"
"sort"
)
// askForConfirmation uses Scanln to parse user input. A user must type in "yes" or "no" and
// then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as
// confirmations. If the input is not recognized, it will ask again. The function does not return
@andreynering
andreynering / ubuntu-set-timezone.sh
Created October 28, 2015 16:43
Ubuntu Set Timezone
# http://www.christopherirish.com/2012/03/21/how-to-set-the-timezone-on-ubuntu-server/
sudo dpkg-reconfigure tzdata
@andreynering
andreynering / paginate.js
Last active October 26, 2015 18:47 — forked from ialpert/paginate.js
paginate extension for lodash/underscore
_.paginate = function(arr, size) {
var pages = [];
arr = _.clone(arr);
size = size || this.length;
while (arr.length) {
pages.push(arr.splice(0, size));
}
@andreynering
andreynering / rails_load_path_tips.md
Created October 7, 2015 15:58 — forked from maxim/rails_load_path_tips.md
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
# Utilize-o em 'config/locales/', com o nome de 'devise.pt-BR.yml'.
# Em 'config/application.rb', utilize => config.i18n.default_locale = :'pt-BR'
pt-BR:
devise:
confirmations:
confirmed: "Sua conta foi confirmada com sucesso."
send_instructions: "Você receberá um e-mail para confirmar sua conta em alguns minutos."
import java.sql.*;
public class TestOracle {
public static void main(String[] args) {
String sql;
/*
* O driver JDBC do Oracle está disponível no seguinte endereço:
* http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html

MS Office prefixed style properties

mso-ansi-font-size

Note: Office only

mso-ansi-font-size: large | larger | <length> | medium | <percentage> | small | smaller | x-large | x-small | xx-large | xx-small