CIAccordionFoldTransition
CIAdditionCompositing
CIAffineClamp
CIAffineTile
CIAffineTransform
CIAreaAverage
CIAreaHistogram
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
# | |
# Print in one line dynamically | |
# | |
from sys import stdout | |
from time import sleep | |
def progress(): | |
for i in range(0,100): | |
stdout.write('\rLoading {}%'.format(i+1)) | |
stdout.flush() |
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 os | |
import socket | |
videos = [] | |
client = socket.socket() | |
client.connect((socket.gethostbyname('localhost'), 3000)) | |
# Append the video files paths into array | |
def load_videos(): | |
base_dir = os.path.dirname(os.path.realpath(__file__)) |
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
# | |
# web/models/user.ex | |
# | |
defmodule Plans.User do | |
use Plans.Web, :model | |
@primary_key {:id, :binary_id, autogenerate: true} | |
schema "users" do | |
field :username, :string | |
field :email, :string |
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
content, err = ioutil.ReadFile("templates/rss.xml") | |
if err != nil { | |
panic(err) | |
} | |
//Custom template helpers | |
fm := template.FuncMap{"number": func(n int) string { | |
return strconv.Itoa(n) | |
}, "float": func(f float64) string { | |
return strconv.FormatFloat(f, 'f', -1, 64) |
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
db.createCollection("jobs", { | |
capped: 1, | |
size: 100000, | |
max: 10 | |
}) |
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
SELECT | |
ID, | |
post_title, | |
post_status, | |
CONCAT('http://www.yourwebsite.com/wp-content/uploads/', | |
thumbnail.meta_value) AS picture, | |
MATCH (post_title) AGAINST ('term') AS title_score, | |
MATCH (post_excerpt) AGAINST ('term') AS excerpt_score, | |
MATCH (post_content) AGAINST ('term') AS content_score | |
FROM wp_posts |
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
-- | |
-- Replace 1 with the post id | |
-- | |
WITH | |
posts_query AS ( | |
SELECT | |
to_tsvector(posts.title) AS posts_title, | |
to_tsvector(posts.tags) AS posts_tags | |
FROM posts | |
), |
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
#!/bin/sh | |
# | |
# On your local machine | |
# | |
# local$ npm install --production | |
# local$ meteor build .build --architecture os.linux.x86_64 | |
# | |
# On your server |
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
# workers | |
# grep processor /proc/cpuinfo | wc -l | |
# | |
# workers connections | |
# ulimit -n | |
# Check the architecture | |
grep --color=always -iw lm /proc/cpuinfo | |
# Buid go workers |