Skip to content

Instantly share code, notes, and snippets.

@faouzzz
faouzzz / index.html
Created May 19, 2016 09:09 — forked from anonymous/index.html
JS Bin time slots selection // source http://jsbin.com/lufufe
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="time slots selection">
<script src="https://code.jquery.com/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<meta charset="utf-8">
@faouzzz
faouzzz / index.html
Created May 19, 2016 18:07 — forked from anonymous/index.html
JS Bin time slots selection // source https://jsbin.com/lufufe
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="time slots selection">
<script src="https://code.jquery.com/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<meta charset="utf-8">
@faouzzz
faouzzz / my_db.rake
Created October 1, 2016 15:35 — forked from jay16/my_db.rake
rails backup DB
#encoding: utf-8
require "fileutils"
namespace :my_db do desc "Backup project database. Options: DIR=backups RAILS_ENV=production MAX=7"
desc "usage - bundle exec rake my_db:backup RAILS_ENV=production MAX=15 DIR=db/db.bak"
task :backup => [:environment] do
# config base dir
datestamp = Time.now.strftime("%Y%m%d%H%M")
base_path = Rails.root
backup_folder = File.join(base_path, ENV["DIR"] || "backups")
FileUtils.mkdir_p(backup_folder) unless File.exist?(backup_folder)
@faouzzz
faouzzz / version-1.js
Created November 1, 2016 21:50 — forked from BaylorRae/version-1.js
Create fixed table headers with jQuery
// http://obvcode.blogspot.com/2007/11/easiest-way-to-check-ie-version-with.html
var Browser = {
version: function() {
var version = 999; // we assume a sane browser
if (navigator.appVersion.indexOf("MSIE") != -1) {
// bah, IE again, lets downgrade version number
version = parseFloat(navigator.appVersion.split("MSIE")[1]);
}
return version;
@faouzzz
faouzzz / _form.html.erb
Last active February 6, 2017 18:00 — forked from kouheiszk/_form.html.erb
simple_form.rb for semantic ui
<%= f.input :email,
wrapper: :semantic_icon_input,
label: false,
required: true,
placeholder: t('users.form.placeholder.email'),
left_icon: 'user' %>
@faouzzz
faouzzz / README.md
Created February 6, 2017 14:31 — forked from atenni/README.md
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@faouzzz
faouzzz / table_to_csv.rb
Created June 12, 2017 15:13 — forked from sandys/table_to_csv.rb
convert a html table to CSV using ruby
# run using ```rvm jruby-1.6.7 do jruby "-J-Xmx2000m" "--1.9" tej.rb```
require 'rubygems'
require 'nokogiri'
require 'csv'
f = File.open("/tmp/preview.html")
doc = Nokogiri::HTML(f)
csv = CSV.open("/tmp/output.csv", 'w',{:col_sep => ",", :quote_char => '\'', :force_quotes => true})
@faouzzz
faouzzz / hack.sh
Created January 5, 2018 09:12 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@faouzzz
faouzzz / .docker_aliases
Created April 29, 2019 14:50 — forked from cjus/.docker_aliases
Docker aliases
#!/bin/sh
alias dm='docker-machine'
alias dmx='docker-machine ssh'
alias dk='docker'
alias dki='docker images'
alias dks='docker service'
alias dkrm='docker rm'
alias dkl='docker logs'
alias dklf='docker logs -f'