Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
$ echo 'echo "hello!"' >> hello.sh | |
$ chmod u+x hello.sh | |
$ ./hello.sh |
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
drop table if exists succursale_saq cascade; | |
create table succursale_saq ( | |
no_succursale_saq text primary key, -- text to allow searching | |
adresse text, | |
ville text | |
); | |
drop table if exists representant cascade; | |
create table representant ( | |
representant_id serial primary key, |
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 re | |
from colorama import Back, Fore, Style | |
def shingles(s, k): | |
ts = set() | |
for i in range(len(s) - k + 1): | |
t = s[i:i+k] | |
ts.add(t) | |
return ts |
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
(setq my-helm-source-file-buffers-list | |
(helm-make-source "Files" 'my-helm-source-file-buffers-class) | |
my-helm-source-nonfile-buffers-list | |
(helm-make-source "Buffers" 'my-helm-source-nonfile-buffers-class)) | |
(setq helm-mini-default-sources '(my-helm-source-file-buffers-list | |
my-helm-source-nonfile-buffers-list | |
helm-source-recentf | |
helm-source-buffer-not-found)) |
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.route('/upload_data', methods=['POST']) | |
def upload_data(): | |
cur = conn.cursor() | |
f = request.files['file'] | |
df = pd.DataFrame.from_csv(f, index_col=False) | |
df.hashtags = df.hashtags.map(ast.literal_eval) | |
screen_name = df.screen_name.unique() | |
assert len(screen_name) == 1 | |
screen_name = screen_name[0] | |
cur.execute('delete from tweets where screen_name = %s', [screen_name]) |
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
# Christian Jauvin <cjauvin@gmail.com> | |
# http://cjauvin.github.com | |
# | |
# Solutions for: | |
# https://www.readyforzero.com/challenge | |
# ajobwelldone+b26e9@readyforzero.com | |
# Problem 1 | |
s = "en3pG3+nz+A2acXKrsyDouhViP9EDQS4JQK6uJqM3rBjKEBKC3yc=AA1=LUQqRPHvQ4dopgkbb/axClP3smzVcaTkRsCqHSG5aKFQ2TbOae0t5r4nWrCVesGK1Z3yEq+dClrDwXXOiAMyW09WdCS+CaKcfu=6kv9dUFBcS4KsUIgwMiXimoBpJZSWlBzILVf4zVA=7GjRP8RXn6uKjbjAPkpFEs/mYJpeOpEnhQfPhjoscgjfL5/SQsU6+jaAf5pg9MQzZdQAEJt7Jm1541fEmnumpjmJMd/MTJ5vzBttBBA7b5rbjDX0nHdTWn8C5suYKfNyYzc6x8S6FIepoEBsMS2mKhx5BRH5jSBrYRem4iQgYARzGnCFot3jPhp3cHj7qjXBWfZZASz8YJqi2d+r393AmdGm1L9NfU2f=FJprbLwJpuE7uT7xAlQA3Ry8aHRNgNkffP29Iqb2DSoQ0PK+9LX0t37HIAhI5zvoP6b4J7yQZEQDgeNlnPQMvSjw9pLWAxQ1VUY+NMU5BLZ2Bxuma1cIsHxcx4PwHcg0u1HYPJAWM2WK=xhJP5aQSc6oNMQK4s2=6guQRVFll6rvWkXTebrdsws7m/Kpa29spUFl8XzFx0ondEMCF3byAyWj875wAI3Hn8ZY92ddTAKj0s+a4X7qSti2lA0GzePHjBjMCD5g9kZYLtB94kkbVZ6eCle/xtto4LHH8GElc5YoUi=mk3nmQ5iOL1zMWfDyRUMLq+HCXbQL9NTejNa/yTdL3sayJOlMW1T7/Jmaz1FMbfBRFzruHeMT41=Zu3nYZJ3nIP22qKrFzNkt/24RuQ+7IMVCI2 |
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 qualified Data.Sequence as Sequence | |
fromList = Sequence.fromList | |
index = Sequence.index | |
update = Sequence.update | |
data Color = Red | | |
Green | | |
Blue | | |
Yellow |
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
# Get everything! handles every single possible select query required | |
# by the app.. | |
# note: field_map is not the nicest thing in the world.. | |
# it should be replaced by something wiser sometime! | |
def query(g, params, tables, query_fields=None, query_op='ilike', what='*', | |
join=None, where=None, field_map=None, group_by=None, order_by=None, | |
include_total=True, debug=False): | |
if query_fields is None: | |
query_fields = () | |
if join is None: |