Skip to content

Instantly share code, notes, and snippets.

View Hazem-Ben-Khalfallah's full-sized avatar

Hazem Ben Khalfallah Hazem-Ben-Khalfallah

View GitHub Profile
@Hazem-Ben-Khalfallah
Hazem-Ben-Khalfallah / git-remove-merged-branches.sh
Last active August 31, 2018 14:27
[Clean up all merger branches] Remove all merged branches #git
git branch -a --merged remotes/origin/master | grep -v master | grep "remotes/origin/" | awk -F'/' '{print substr($0, index($0,$3))}' | xargs -n 1 git push --delete origin
@Hazem-Ben-Khalfallah
Hazem-Ben-Khalfallah / Pdf vocal reader
Last active August 31, 2018 14:48
[Pdf vocal reader] An application that reads a pdf content #idea
text to speech app
https://freetts.sourceforge.io/
search for TTS app
@Hazem-Ben-Khalfallah
Hazem-Ben-Khalfallah / parse number.java
Last active August 31, 2018 15:03
[Parse String number] parse String number with different decimal and grouping separator #java
package com.influans.wonderland.babland.onboarding.performer;
import com.influans.wonderland.babland.dto.CsvMappingItem;
import com.influans.wonderland.babland.dto.CsvMappingList;
import com.influans.wonderland.babland.dto.ImportableDto;
import com.influans.wonderland.babland.entity.MappingRuleEntity;
import com.influans.wonderland.babland.entity.enums.RuleEnum;
import com.influans.wonderland.babland.enums.CatalogProductFieldsEnum;
import com.influans.wonderland.babland.onboarding.Context;
import com.influans.wonderland.babland.onboarding.ElementWrapper;
@Hazem-Ben-Khalfallah
Hazem-Ben-Khalfallah / observe in link.js
Last active August 31, 2018 15:16
[Observe directive] observe value in directive #angularjs
@Hazem-Ben-Khalfallah
Hazem-Ben-Khalfallah / maintenanceMode
Last active July 21, 2022 08:27
[Heroku maintenance mode] enable/disable heroku maintenance mode #heroku
ON:
heroku maintenance:on --app APP_NAME
OFF:
heroku maintenance:off --app APP_NAME
@Hazem-Ben-Khalfallah
Hazem-Ben-Khalfallah / install redis.sh
Last active August 31, 2018 15:20
[Redis up at Ubuntu's upstart ] Running redis using upstart on Ubuntu #linux #redis
To install:
sudo apt-get install redis-server
That will create a redis user and install the init.d script for it. Since upstart is now the replacement for using init.d, I figure I should convert it to run using upstart.
To disable the default init.d script for redis:
sudo update-rc.d redis-server disable
Then create /etc/init/redis-server.conf with the following script:
@Hazem-Ben-Khalfallah
Hazem-Ben-Khalfallah / netstat.sh
Last active August 31, 2018 15:19
[Processes and Port Usage] Ubuntu view Processes and Port Usage #linux
netstat -tulpn
@Hazem-Ben-Khalfallah
Hazem-Ben-Khalfallah / refresh page.js
Last active August 31, 2018 15:22
[refresh page] refresh page with #javascript
location.reload();
@Hazem-Ben-Khalfallah
Hazem-Ben-Khalfallah / ssh key.sh
Last active August 31, 2018 15:23
[SSH key generation] Create ssh key with openSSH #linux #ssh
//generate ssh-key
https://help.github.com/articles/generating-ssh-keys
//permision denied solution
https://help.github.com/articles/error-permission-denied-publickeycompress & decompress a String
@Hazem-Ben-Khalfallah
Hazem-Ben-Khalfallah / checkbox value.js
Last active August 31, 2018 15:24
[Checkbox value] read checkbox using #jquery #javascript
$('#isFeatured').is(':checked')