Skip to content

Instantly share code, notes, and snippets.

View giannisdaras's full-sized avatar
:octocat:

Giannis Daras giannisdaras

:octocat:
View GitHub Profile
@papachristoumarios
papachristoumarios / download_gdrive.sh
Created July 24, 2019 15:20
Download from Google Drive via terminal
#!/bin/bash
# Usage download_gdrive.sh file_id outfile
CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
rm -rf /tmp/cookies.txt
@korakot
korakot / bucket.py
Last active September 29, 2022 21:40
Mount GCS bucket on Colab
from google.colab import auth
auth.authenticate_user()
!echo "deb http://packages.cloud.google.com/apt gcsfuse-bionic main" > /etc/apt/sources.list.d/gcsfuse.list
!curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
!apt -qq update
!apt -qq install gcsfuse
!mkdir co-lab
!gcsfuse co-lab /content/co-lab
@thomwolf
thomwolf / parallel.py
Last active August 8, 2023 15:50
Data Parallelism in PyTorch for modules and losses
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Hang Zhang, Rutgers University, Email: zhang.hang@rutgers.edu
## Modified by Thomas Wolf, HuggingFace Inc., Email: thomas@huggingface.co
## Copyright (c) 2017-2018
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this source tree
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"""Encoding Data Parallel"""
@W4ngatang
W4ngatang / download_glue_data.py
Last active May 23, 2024 12:55
Script for downloading data of the GLUE benchmark (gluebenchmark.com)
''' Script for downloading all GLUE data.
Note: for legal reasons, we are unable to host MRPC.
You can either use the version hosted by the SentEval team, which is already tokenized,
or you can download the original data from (https://download.microsoft.com/download/D/4/6/D46FF87A-F6B9-4252-AA8B-3604ED519838/MSRParaphraseCorpus.msi) and extract the data from it manually.
For Windows users, you can run the .msi file. For Mac and Linux users, consider an external library such as 'cabextract' (see below for an example).
You should then rename and place specific files in a folder (see below for an example).
mkdir MRPC
cabextract MSRParaphraseCorpus.msi -d MRPC
@ThemisB
ThemisB / Diavgeia_FinalReport.md
Created August 22, 2017 09:41
Final Report of Diavgeia GSOC 2017

This is a final report of the work which was done as part of Diavgeia GSOC17 Project (https://github.com/eellak/gsoc17-diavgeia).

Abstract

Diavgeia is the greek transparency portal, which all government institutions are obliged to use, in order to upload their decisions online. In this GSoC project, i promoted even more its transparency and enhanced the functionality of the Diavgeia, by:

  • Creating a RDF Schema for the decisions of government institutions.
  • Using Blockchain technology (Bitcoin) to ensure immutability of decisions over time.
  • Providing a sample of RDF decisions expressed in Notation3(N3) complying to our rdf schema.
  • Creating a UI that government institutions can use to compose their N3 decisions using a html form.
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active June 9, 2024 21:23
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@roachhd
roachhd / README.md
Last active June 7, 2024 09:32
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

@rxaviers
rxaviers / gist:7360908
Last active June 11, 2024 21:17
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@trevordixon
trevordixon / modExp.hs
Created October 2, 2013 03:00
Modular Exponentiation in Haskell
import Data.Bits
modExp :: Integer -> Integer -> Integer -> Integer
modExp b 0 m = 1
modExp b e m = t * modExp ((b * b) `mod` m) (shiftR e 1) m `mod` m
where t = if testBit e 0 then b `mod` m else 1
@edalorzo
edalorzo / basic-list-functions.sml
Last active July 15, 2021 17:04
Learning SML - Basic List Functions
(* Returns the head of a list. *)
fun head(xs) =
case xs of
[] => raise List.Empty
| (x::_) => x
(* Returns the tail of a list. *)
fun tail(xs) =
case xs of
[] => raise List.Empty