The update_or_create
model function was updated in Django 5.0 with a create_defaults
argument that allows only used during create operations.
> time go run cryptocoinmarketcap.go
2017/12/19 17:26:38 Scraping finished, check file "cryptocoinmarketcap-go.csv" for results
2.24 real 0.84 user 0.45 sys
> time python3 cryptocoinmarketcap.py
WARNING:root:Scraping finished, check file cryptocoinmarketcap-py.csv for results
3.51 real 2.94 user 0.07 sys
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 python3 | |
import argparse | |
import math | |
import os.path | |
import pandas as pd | |
import numpy as np | |
def main(filepath): |
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 datetime | |
from fabric.api import cd, env, task, run | |
from fabric.contrib.project import rsync_project | |
from fabric.utils import puts | |
env.hosts = ['127.0.0.1'] | |
env.user = 'serverpilot' | |
env.app_dir = '~/apps/laravel/' | |
env.releases_dir = '~/.releases/laravel' |
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 datetime | |
import yaml | |
from ansible_vault.api import Vault | |
from fabric.api import env, execute, get, local, put, run, task | |
env.user = 'root' | |
env.now = datetime.datetime.now().strftime('%Y-%m-%dT%H-%M-%S') | |
env.roledefs = { |
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 python3 | |
import argparse | |
def encode(secret): | |
binary = bin(int.from_bytes(secret.encode(), 'big')) | |
return binary[2:].replace('0', '❤️').replace('1', '💜') | |
def decode(code): |
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 WordPress from 'wpcom'; | |
import { css } from 'glamor' | |
import React from 'react'; | |
let PostStyle = css({ | |
borderBottomColor: '#ccc', | |
borderBottomStyle: 'solid', | |
borderBottomWidth: '1px', | |
margin: '1em 0', |
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
<html> | |
<head><title>Fuzzy Search</title> | |
<script id="algorithm"> | |
// YOUR CODE HERE ! | |
</script> |
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
# A simple Makefile alternative to using Grunt for your static asset compilation | |
# | |
## Usage | |
# | |
# $ npm install | |
# | |
# And then you can run various commands: | |
# | |
# $ make # compile files that need compiling | |
# $ make clean all # remove target files and recompile from scratch |
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
for pptx in *.pptx; | |
do | |
libreoffice --headless --convert-to pdf $pptx | |
convert -density 400 `basename $pptx`.pdf -resize 2000x1500 `basename $pptx`%d.jpg | |
rm `basename $pptx`.pdf | |
done |
NewerOlder