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
# -*- coding: utf-8 -*- | |
# create sorting python in list csv | |
from random import shuffle | |
import os | |
class DoorPrize(object): | |
def __init__(self, list_to_sort=[]): | |
self.list_to_sort = list(set(list_to_sort)) |
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
# Install dependencies | |
yum groupinstall -y 'development tools' | |
yum install -y zlib-devel bzip2-devel openssl-devel xz-libs wget | |
# Download the Python source and unpack it | |
wget http://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz | |
xz -d Python-2.7.9.tar.xz | |
tar -xvf Python-2.7.9.tar | |
# Enter the directory, configure, and install |
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 calendar | |
from datetime import datetime, date, timedelta | |
class Agenda(object): | |
def __init__(self): | |
self._month = datetime.today().month | |
self._year = datetime.today().year |
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
# -*- coding: utf-8 -*- | |
import os | |
import unicodedata | |
from collections import defaultdict, Counter | |
from operator import itemgetter, attrgetter | |
local = os.path.dirname(__file__) | |
file_imput = local + '/natural_keys_scl.csv' | |
file_out = local + '/natural_keys_output.csv' |
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
# https://www.hackerrank.com/challenges/ruby-enumerable-collect | |
def rot(string, num) | |
if num > 25 | |
num = num - (25 *(num/25)) | |
end | |
new_UpFirst = (65 + num).chr | |
new_UpLast = (65 + num - 1).chr | |
new_DwnFirst = (97 + num).chr | |
new_DwnLast = (97 + num - 1).chr | |
case num |
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
# https://www.hackerrank.com/challenges/pairs | |
def pairs(ar,diff) | |
count = 0 | |
hash = Hash[ar.zip] | |
ar.each do |x| | |
if(hash[x] == nil) | |
ahead = x + diff | |
behind = x - diff | |
if(hash.has_key?(ahead) and (hash[ahead] == nil) ) | |
count +=1 |
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..: 11/06/2016 | |
* Prototype developed in Bluehack event on IBM | |
*/ | |
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space | |
#include <ESP8266WiFi.h> | |
#include <BlynkSimpleEsp8266.h> | |
#include <SimpleTimer.h> | |
#include <DHT.h> |
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 python:2.7 | |
RUN mkdir -p /opt/app | |
WORKDIR /opt/app | |
RUN apt-get update && apt-get install awscli libmemcached-dev -y | |
RUN mkdir -p /opt/app/static | |
#RUN aws s3 sync s3://rootair.cdn/development/static/whitelabel /opt/app/static/whitelabel | |
RUN chmod -R a+rx /opt/app/static |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<p>Click the button to get your coordinates.</p> | |
<button id ='getCoordinates'>Try It</button> | |
<p id='coordinates'></p> |
OlderNewer