This file contains hidden or 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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
This file contains hidden or 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
ARG_COUNT=2 | |
if [ ! $# -eq $ARG_COUNT ]; then | |
echo "Usage: $0 <arg1> <arg2>" | |
exit 1 | |
fi | |
This file contains hidden or 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
for arg in "$@" | |
do | |
echo "Arguments: $arg" | |
done |
This file contains hidden or 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
SCIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
This file contains hidden or 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
stty -echo | |
read -p "Password: " PASSWORD; echo | |
stty echo |
This file contains hidden or 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
CC=g++ | |
LINKER=$(CC) | |
CFLAGS=-c -Wall | |
LDFLAGS= | |
SOURCES=main.cpp | |
OBJECTS=$(SOURCES:.cpp=.o) | |
EXECUTABLE=posix | |
all: clean $(SOURCES) $(EXECUTABLE) | |
This file contains hidden or 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
require 'rake' | |
require 'rake/clean' | |
# Configuration | |
START_MODULE = "main" | |
TEST_MODULE = "test_myerlang" | |
# No Need to change | |
PWD = `pwd`.strip | |
INCLUDE = "include" |
This file contains hidden or 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
PACKAGENAME=gcc | |
if dpkg-query -W $PACKAGENAME | |
then | |
echo "You have $PACKAGENAME installed" | |
else | |
echo "You don't have $PACKAGENAME installed" | |
fi |
This file contains hidden or 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
require 'sinatra' | |
get '/' do | |
"<html><body><h1>Hello World</h1></body></html>" | |
end |
This file contains hidden or 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
# Run using the below commands | |
# pip install Flask | |
# python server.py | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
return "<html><body><h1>Hello World</h1></body></html>" |
OlderNewer