Skip to content

Instantly share code, notes, and snippets.

View ouaziz's full-sized avatar
💭
I may be slow to respond.

ouaziz mouhcine ouaziz

💭
I may be slow to respond.
View GitHub Profile
@ouaziz
ouaziz / heroku words generator.rb
Last active August 2, 2016 14:40
heroku like word generator to made a cool names for your beta projects.
adjs = [
"autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark",
"summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter",
"patient", "twilight", "dawn", "crimson", "wispy", "weathered", "blue",
"billowing", "broken", "cold", "damp", "falling", "frosty", "green",
"long", "late", "lingering", "bold", "little", "morning", "muddy", "old",
"red", "rough", "still", "small", "sparkling", "throbbing", "shy",
"wandering", "withered", "wild", "black", "young", "holy", "solitary",
"fragrant", "aged", "snowy", "proud", "floral", "restless", "divine",
"polished", "ancient", "purple", "lively", "nameless"
@ouaziz
ouaziz / Rails_Template.rb
Created January 13, 2014 15:27
Rails template example to generate a new ruby on rails project with a professionalized sign-in, sessions, plans, rolse, multi-tenant, jquery, bootstrap 3 (flat design) ...
# add gems
gem 'whenever'
gem 'kaminari'
gem 'hpricot'
gem 'ruby_parser'
gem 'jquery-rails'
gem "jquery-ui-rails"
gem 'bcrypt-ruby', '~> 3.0.0'
gem "rspec-rails", :group => [ :development, :test ]
gem "ffaker", :group => :test
@ouaziz
ouaziz / Create_directory.rb
Created May 22, 2015 23:13
Create directory
def create_directory name
directory_name = name
Dir.mkdir(directory_name) unless File.exists?(directory_name)
puts "Directory #{name} created"
end
@ouaziz
ouaziz / directory_size
Created May 22, 2015 23:14
directory size
def directory_size(path)
path << '/' unless path.end_with?('/')
raise RuntimeError, "#{path} is not a directory" unless File.directory?(path)
total_size = 0
Dir["#{path}**/*"].each do |f|
total_size += File.size(f) if File.file?(f) && File.size?(f)
end
# size in bytes
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember exemple'
});
puts "start..."
require 'tiny_tds'
client = TinyTds::Client.new username: 'sa', password: '123***s', host: '192.168.1.215', port: 1433, database: 'alyamama'
#results = client.execute("SELECT * FROM motif_controle")
#puts results.fields
#results.each do |row|
# puts row
#end
#puts "---------------"
results = client.execute("EXEC sp_test")
ActiveRecord::Base.connection.tables.each { |t| ActiveRecord::Base.connection.reset_pk_sequence!(t) }
@ouaziz
ouaziz / components.reading-list.js
Last active January 29, 2018 16:09
Reading-list
import Ember from 'ember';
export default Ember.Component.extend({
value: "",
actions: {
onEnter(title) {
if (title) {
@ouaziz
ouaziz / install or update ruby and rails on centos.txt
Last active November 2, 2023 18:13
install or update ruby and rails on centos
#Remove old Ruby
$ yum remove ruby
# Install dependencies
$ yum groupinstall "Development Tools"
$ yum install zlib zlib-devel
$ yum install openssl-devel
$ wget http://pyyaml.org/download/libyaml/yaml-0.1.5.tar.gz
$ tar xzvf yaml-0.1.5.tar.gz
$ cd yaml-0.1.5
@ouaziz
ouaziz / Configure Git to use a proxy
Last active January 31, 2024 00:45
Configure Git to use a proxy
git config --global http.proxy http://proxyUsername:proxyPassword@proxy.server.com:port
OR
git config --global http.proxy http://proxy.server.com:port