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
x = [0,3,2,5,4,6,1] | |
i=0 | |
T=0 | |
while i != 5: | |
i = i + 1 | |
T = T + x[i] | |
print T |
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
Date.daysBetween = function (date_now, date_future) { | |
// get total seconds between the times | |
var delta = Math.abs(date_future - date_now) / 1000; | |
delta_orig = delta; | |
// calculate (and subtract) whole days | |
var days = Math.floor(delta / 86400); | |
delta -= days * 86400; | |
// calculate (and subtract) whole hours |
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
from time import sleep | |
while True: | |
print "Up Down: Green" | |
print "Left Right: Red" | |
sleep((60*5) - 60) #It will take us 1 minute to changes the lights, so 5 minutes - one minute | |
print "Up Down: Yellow" | |
print "Left Right: Red" | |
sleep(30) # Let People Stop | |
print "Up Down: Red" |
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
app.directive('dynamicTime', ['$timeout', '$log', | |
function ($timeout, $log) { | |
return { | |
restrict: 'E', | |
scope: { | |
time: '=', | |
prefix: '@', | |
suffix: '@' | |
}, | |
controller: function ($scope) { |
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
#!usr/bin/env/ python | |
# Python Script to automatically Poke people on facebook | |
# By Sebin Thomas | |
# USE AT YOUR OWN RISK | |
# It was written in a Hurry so no error handling whatsoever and there may be a zillion Bugs | |
# And it's not Safe | |
# THOSE WHO USE THIS CODE ARE DOING SO IN THEIR OWN RISK AND THE AUTHOR | |
# IS NOT ACCOUNTABLE FOR ANY DAMAGE WHATSOEVER | |
# Usage : poke.py Username password | |
import urllib2 |
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
#AES Key file export location | |
$KeyFile = "C:\AES.key" | |
#Generate Key | |
$Key = New-Object Byte[] 16 # You can use 16, 24, or 32 for AES | |
[Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($Key) | |
#write key to file | |
$Key | out-file $KeyFile |
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
def is_logged_in(): | |
if flask.session.has_key("profile_complete"): | |
""" | |
For every request, we're going to make sure that the user is Authenticated with Google. | |
This way we can make sure that when an account is disabled in Google, this Application | |
immediately stops working. | |
Its dirty and slow, but it works. | |
""" | |
http = oauth2.http() |
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
import email | |
import argparse | |
from bs4 import BeautifulSoup | |
parser = argparse.ArgumentParser() | |
parser.add_argument("-e", "--email", help="Path to Email file", default="example.txt") | |
args = parser.parse_args() | |
def _extractHtml(msg): | |
response = "" |
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 app = angular.module('DashboardApp', ['ngMaterial']); | |
var _theme; | |
app.config(function ( $mdThemingProvider) { | |
$mdThemingProvider | |
.theme('default') | |
.accentPalette('orange') | |
.dark(); | |
_theme = $mdThemingProvider.theme(); |
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
function doGet(e) { | |
var salt = "Djdids((cx"; | |
var page = HtmlService | |
.createTemplateFromFile('index') | |
page.data = { | |
AnalyticsUserID: getHash(salt + Session.getActiveUser().getEmail()) | |
}; | |
page.params = { |