Skip to content

Instantly share code, notes, and snippets.

View sabman's full-sized avatar
😀
Building, Shiping, Sharing!

Shoaib Burq sabman

😀
Building, Shiping, Sharing!
View GitHub Profile
@twetzel
twetzel / deploy.rb
Last active February 22, 2018 09:37 — forked from Jesus/deploy.rb
compile assets local with capistrano 3.2.1 and rails 4.1.1 (fully integrated)
# Clear existing task so we can replace it rather than "add" to it.
Rake::Task["deploy:compile_assets"].clear
namespace :deploy do
desc 'Compile assets'
task :compile_assets => [:set_rails_env] do
# invoke 'deploy:assets:precompile'
invoke 'deploy:assets:precompile_local'
invoke 'deploy:assets:backup_manifest'
@rodneyrehm
rodneyrehm / gist:40e7946c0cff68a31cea
Last active March 12, 2025 19:23
Diagrams for Documentation

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@learncodeacademy
learncodeacademy / generators.md
Last active January 7, 2024 11:58
What are Javascript Generators?

##what are generators##

  • They're pausable functions, pausable iterable functions, to be more precise
  • They're defined with the *
  • every time you yield a value, the function pauses until .next(modifiedYieldValue) is called
var myGen = function*() {
  var one = yield 1;
  var two = yield 2;
  var three = yield 3;
 console.log(one, two, three);
@hopsoft
hopsoft / db.rake
Last active July 4, 2025 14:22
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd
@javisantana
javisantana / index.html
Last active October 1, 2017 14:41
mapbox.js + cartodb.core.js - useful when you want to show cartodb tiles on top of mapbox layers
<!DOCTYPE html>
<html>
<head>
<meta charaset=utf-8 />
<title>mapbox.js + cartodb.js</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox.js/v1.6.2/mapbox.css' rel='stylesheet' />
<script src='https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/cartodb.core.js'></script>
@rigelk
rigelk / maintenance.html
Last active August 29, 2015 14:00
Maintenance clean page
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>Maintenance du site</title>
<style>
h1 { color: rgb(220, 129, 0); font-size: 50px; letter-spacing: -5px; position: relative;}
h1:after { color: rgba(100, 200, 255, 0.5); content: "Oh noes!"; left: 4px; position: absolute; top: 5px;}
body { color: rgb(51, 51, 51); font: 20px Helvetica,sans-serif; padding-top: 150px;}
#article { display: block; margin: auto; text-align: left; width: 650px;}
@chunlea
chunlea / input-group-in-simple-form.md
Last active October 5, 2021 20:03
How to use Boostrap 3 input-group in Simple Form

Finally, Simple Form support Boostrap 3. 👏

But I found it still dosen't support some components in Bootstrap 3. Or may be in the future. But I can't wait, so I find a solution to support them. It was inspired by heartcombo/simple_form#531 (comment) .

This is a final solution and I used in my project.

simple_form

Windshaft-cartodb/config/environments/development.js
var config = {
environment: 'development'
,port: 8181
,host: ''
// Regular expression pattern to extract username
// from hostname. Must have a single grabbing block.
,user_from_host: '^(.*)\\.localhost'
// Maximum number of connections for one process
// 128 is a good value with a limit of 1024 open file descriptors
@sharipov-ru
sharipov-ru / development.rb
Last active December 20, 2016 14:20 — forked from dhh/gist:2492118
config.middleware.use RoutesReloader