Skip to content

Instantly share code, notes, and snippets.

View gentlyawesome's full-sized avatar
🏠
Working from home

Arc Angelo Ibalio gentlyawesome

🏠
Working from home
  • Philippines
View GitHub Profile
@gentlyawesome
gentlyawesome / git_log
Created September 17, 2014 07:01
Beautiful Git Log Format
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@gentlyawesome
gentlyawesome / Gemfile
Created October 28, 2014 04:56
Sample Rails 3.2 list of gem for testing
source 'https://rubygems.org'
gem 'rails', '3.2.14'
gem 'mysql2'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
@gentlyawesome
gentlyawesome / SanitizeUrl.php
Last active August 29, 2015 11:01 — forked from gabrielef/SanitizeUrl.php
Convert title to seo friendly url
<?php
class SanitizeUrl {
public static function slug($string, $space="-") {
$string = utf8_encode($string);
if (function_exists('iconv')) {
$string = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
}
$string = preg_replace("/[^a-zA-Z0-9 \-]/", "", $string);
@gentlyawesome
gentlyawesome / _example_ng-file-upload.md
Created March 31, 2018 15:47 — forked from aksakalli/_example_ng-file-upload.md
ng-file-upload example with NodeJS

ng-file-upload example with NodeJS

index.html should be in public folder in the same directory with app.js.

@gentlyawesome
gentlyawesome / ultimate-ut-cheat-sheet.md
Created July 31, 2018 00:28 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@gentlyawesome
gentlyawesome / docker-help.md
Created February 19, 2019 02:09 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

#!usr/bin/python
"""
Sample python script to migrate documents from mongodb to apache couchdb database.
This script reads a document from mongodb and writes it to couchdb database.
**Script does not support the use case for 'documents with attachments'
"""
from bson import json_util, objectId
import json
from argparse import ArgumentParser
import requests
du -hsx -- * | sort -rh | head -10
If your time does not permit the close supervision of your project then i am here for your help related with LAMP or LEMP Stack and others.
Contact Me For Engaged Your Works:
Telegram: https://t.me/LinuxGun
WhatsApp: https://wa.link/5ow7oz
#!/bin/bash
# This will remove Apache
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin
const crypto = require('crypto');
// Transactions
const transactions = ['T1', 'T2', 'T3', 'T4', 'T5'];
// Merkle Root Calculation
function calculateMerkleRoot(transactions) {
if (transactions.length === 0) {
return null;
}