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
{ | |
"100": "💯", | |
"1234": "🔢", | |
"grinning": "😀", | |
"smiley": "😃", | |
"smile": "😄", | |
"grin": "😁", | |
"laughing": "😆", | |
"satisfied": "😆", | |
"sweat_smile": "😅", |
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
function randomHSVPalette(options) { | |
function random(min, max) { | |
return min + Math.random() * (max - min); | |
} | |
function HSVtoXYZ(hsv) { | |
var h = hsv[0]; | |
var s = hsv[1]; | |
var v = hsv[2]; |
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
# Set the seed for hash based operations in python | |
os.environ['PYTHONHASHSEED'] = '0' | |
seed=1234 | |
# set the seed for random number generator | |
rn.seed(seed) | |
# Set the numpy seed | |
np.random.seed(seed) |
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
git remote add origin https://github.com/loretoparisi/phoenix-elixir-boilerplate.git | |
git add * | |
git commit -m "Initial Import" | |
git push --set-upstream origin master | |
git push origin master |
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
brew update | |
brew install elixir | |
mix local.hex | |
mix archive.install hex phx_new 1.4.3 | |
mix phx.new hello --no-ecto | |
cd hello | |
mix phx.server | |
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
import json | |
class SetEncoder(json.JSONEncoder): | |
def default(self, obj): | |
if isinstance(obj, set): | |
return list(obj) | |
return json.JSONEncoder.default(self, obj) |
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
add-apt-repository ppa:jonathonf/python-3.6 | |
apt-get update & apt-get install -y python3.6 | |
curl https://bootstrap.pypa.io/get-pip.py > get-pip.py | |
python3.6 get-pip.py | |
pip3 uninstall tensorflow-gpu | |
pip3.6 install tensorflow-gpu==1.12.0 | |
python3.6 -c "import tensorflow as tf; print(tf.__version__);" |
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
Containers: 3 | |
Running: 1 | |
Paused: 0 | |
Stopped: 2 | |
Images: 93 | |
Server Version: 18.09.2 | |
Storage Driver: overlay2 | |
Backing Filesystem: extfs | |
Supports d_type: true | |
Native Overlay Diff: true |
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
url="https://audio-ssl.itunes.apple.com/apple-assets-us-std-000001/AudioPreview114/v4/3a/19/2e/3a192eb6-9643-19ca-2411-78cf3f7d8434/mzaf_6193260726294400087.plus.aac.p.m4a" | |
CHUNK = 2 * 1024 # change buffer size depending on file size, etc. | |
FOUT = 'test.m4a' | |
response = urlopen(url) # this will get the binary file contents | |
with open(FOUT, 'wb') as f: | |
while True: | |
chunk = response.read(CHUNK) | |
if not chunk: | |
break | |
f.write(chunk) |
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
const URL = https://itunes.apple.com/us/curator/976439548#see-all/playlists | |
const NAME = "YOUR_NAME" | |
var playlist_names=$('.we-lockup__title') | |
var playlist_links = $('.targeted-link'); | |
var apple_music_playlists=[]; | |
playlist_names.each((index,elem) => { | |
var link = playlist_links[index]; | |
var playlist = {}; | |
playlist.url= $(link).attr('href') |