Skip to content

Instantly share code, notes, and snippets.

View zackbraksa's full-sized avatar

Zack Braksa zackbraksa

View GitHub Profile
class CommunitiesController < ApplicationController
# ...
def show
@community = Community.find(params[:id])
@users = @community.users
@ressources = Ressource.paginate(:page => params[:page], :per_page => 5)
end
//
// PickCityViewController.h
//
// Created by zakaria on 12/28/13.
// Copyright (c) 2013 Zakaria Braksa. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PickCityViewController : UIViewController<UITableViewDelegate, UITableViewDataSource,UISearchBarDelegate, UISearchDisplayDelegate>{
//
// PickCityViewController.m
//
// Created by zakaria on 12/28/13.
// Copyright (c) 2013 Zakaria Braksa. All rights reserved.
//
#import "PickCityViewController.h"
#import <AFNetworking.h>
#import <SVProgressHUD.h>
Herat, Afghanistan
Kabul, Afghanistan
Mazar-e Sharif, Afghanistan
Korce, Albania
Tirane, Albania
Algiers, Algeria
Skikda, Algeria
Oran, Algeria
Ouled Djellal, Algeria
Mascara, Algeria
@zackbraksa
zackbraksa / deploy.rb
Last active August 29, 2015 14:06 — forked from lenart/deploy.rb
namespace :figaro do
desc "SCP transfer figaro configuration to the shared folder"
task :setup do
transfer :up, "config/application.yml", "#{shared_path}/application.yml", via: :scp
end
desc "Symlink application.yml to the release path"
task :symlink do
run "ln -sf #{shared_path}/application.yml #{latest_release}/config/application.yml"
end
@zackbraksa
zackbraksa / fig.yml
Created October 15, 2014 16:24
Fig script to launch an edx instance.
edx:
image: qbraksa/edx
ports:
- "18010:18010"
- "18080:18080"
#!/bin/bash
pink='\e[35m'
NC='\e[0m' # No Color
set -e
set -u
apt-get -y install wget
#!/bin/bash
find . -name "*.${1}" | while read fname
do
mv $fname "${fname/.${1}}.$2"
done
@zackbraksa
zackbraksa / README.md
Last active November 19, 2021 20:25
Change the filename extension of multiple files in a directory.( e.g change all .html to .php )

Extensions

Change the filename extension of multiple files in a directory.( e.g change all .html to .php )

Usage

  1. Place "extensions.py" file inside the directory where you want to change file extensions.

  2. Open your terminal, execute a command that should look like this :

     python extensions.py oldExtension newExtension
    

Where oldExtension should be the file extension you wanna change (html,php ...) for all files in that directory. And newExtension is the extenstion you wanna change oldExtension to.