Skip to content

Instantly share code, notes, and snippets.

Abboud digitup

View GitHub Profile
@digitup
digitup / mac.sh
Created Nov 5, 2016 — forked from pwnsdx/disable.sh
Disable bunch of #$!@ in Sierra
View mac.sh
#!/bin/bash
# This is a draft but it works
# FIRST (I don't even know if it works but we'll assume yes)
# sudo launchctl list
# sudo launchctl disable system/netbiosd
# sudo launchctl disable system/parsecd
# sudo launchctl disable system/parentalcontrols.check
# sudo launchctl disable system/airportd
View frontendDevlopmentBookmarks.md
View zsh.md

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh

and then you change your shell to zsh

chsh -s `which zsh`

and then restart

@digitup
digitup / LoadMultipleScriptsAsync.js
Created Mar 14, 2013
JavaScript - Load multiple 3rd party widgets asyncronously.
View LoadMultipleScriptsAsync.js
var script,
scripts = document.getElementsByTagName('script')[0],
scriptList = {
'plusone' : '//apis.google.com/js/plusone.js',
'twitter' : '//platform.twitter.com/widgets.js',
'someother': '//s.widgetsite.com/widget.js'
};
for (var id in scriptList) {
script = document.createElement('script');
@digitup
digitup / securePhpMyAdmin.sh
Created Mar 10, 2013
Server - Secure phpMyAdmin
View securePhpMyAdmin.sh
//install phpmyadmin
sudo apt-get install phpmyadmin
//After the installation has completed, add phpmyadmin to the apache configuration.
sudo nano /etc/apache2/apache2.conf
//add phpmyadmin to config file
Include /etc/phpmyadmin/apache.conf
@digitup
digitup / database.sh
Last active Dec 14, 2015
Backup and restore database
View database.sh
rsync /var/lib/mysql root@destination.server.com:/var/lib/ -a
Or:
//Export Database
mysqldump -uUsername -p Database > db_backup.sql
 
//Export Multiple databases
mysqldump -uUsername -p --databases db_name1 [db_name2 ...] > db_backup.sql
@digitup
digitup / zip.sh
Created Mar 10, 2013
Server - Zip a folder
View zip.sh
find /full_path -path '*/.*' -prune -o -type f -print | zip ~/file.zip -@
@digitup
digitup / GetURLParameters.js
Created Feb 25, 2013
JavaScript - Get URL Parameters
View GetURLParameters.js
function getParameterByName(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if(results == null)
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
@digitup
digitup / windowWidth.html
Last active Dec 10, 2015
jQuery - windowWidth
View windowWidth.html
<script>
$(window).resize(function() {
var windowWidth = $(window).width();
$('.screen-width').text(windowWidth + 'px');
});
</script>
<div id="debug" style="position:fixed;padding:0.3em 0.6em;background:#f1f1f1;font-size:0.6em;bottom:0;left:50%;">
<span class="screen-width">0</span>
</div>
@digitup
digitup / checkURLHash.js
Created Dec 20, 2012
JS - Check URL hash
View checkURLHash.js
function checkHash(backButton) {
if(window.location.hash) {
backButton = true;
} else {
backButton = false;
}
return backButton;
You can’t perform that action at this time.