This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var url = require('url'); | |
var path = require('path'); | |
var fs = require('fs'); | |
var port = process.argv[2] || 8080; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname; | |
var filename = path.join(process.cwd(), uri); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo apt-get install apache2-prefork-dev libxml2 libxml2-dev apache2-dev | |
mkdir ~/modbuild/ && cd ~/modbuild/ | |
wget http://apache.webthing.com/svn/apache/filters/mod_xml2enc.c | |
wget http://apache.webthing.com/svn/apache/filters/mod_xml2enc.h | |
sudo apxs2 -aic -I/usr/include/libxml2 ./mod_xml2enc.c | |
cd ~ | |
sudo rm -rfd ~/modbuild/ | |
sudo service apache2 restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -d "$HOME/bin" ] ; then | |
PATH="$HOME/bin:$PATH" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module( ... ) | |
.config(['$ionicTabsConfig', function($ionicTabsConfig) { | |
// Override the Android platform default to add "tabs-striped" class to "ion-tabs" elements. | |
$ionicTabsConfig.type = ''; | |
}]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#for f in * | |
#do | |
# moddate=$(date -r "$f" +"%Y%m%d_%H%M%S") | |
# mv "$f" "IMG_$moddate.jpg" | |
#done | |
exiftool -v '-filename<datetimeoriginal' IMG_%Y%m%d_%H%M.jpg * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exiftool '-datetimeoriginal<filename' IMG_%Y%m%d_%H%M.jpg * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const roundDecimalPlaces = (num, decimalPlaces) => { | |
// default: 1 decimal places | |
decimalPlaces = !decimalPlaces ? 1 : decimalPlaces; | |
return Math.round(num * 10 * decimalPlaces) / (10 * decimalPlaces); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const validEmailRegexp = /^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i; | |
const isValidEmail = email => validEmailRegexp.test(email); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT c.name AS 'ColumnName' | |
,t.name AS 'TableName' | |
FROM sys.columns c | |
JOIN sys.tables t ON c.object_id = t.object_id | |
WHERE c.name LIKE '%MyName%' | |
ORDER BY TableName | |
,ColumnName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT COLUMN_NAME AS 'ColumnName' | |
,TABLE_NAME AS 'TableName' | |
FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE COLUMN_NAME LIKE '%MyName%' | |
ORDER BY TableName | |
,ColumnName; |
OlderNewer