-
Find the Discord channel in which you would like to send commits and other updates
-
In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe!
-- This presents an example of rendering templates in the database. | |
-- DO NOT DO THIS! It's a terrible idea, and just example for my talk | |
-- which you can see at https://speakerdeck.com/andrewgodwin/dubious-database-design | |
CREATE EXTENSION plpythonu; | |
-- Table to store template HTML by name | |
CREATE TABLE templates ( | |
"name" text PRIMARY KEY, | |
"template" text |
# Source: | |
# https://www.cloudflare.com/ips | |
# https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables- | |
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done | |
for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done | |
# Avoid racking up billing/attacks | |
# WARNING: If you get attacked and CloudFlare drops you, your site(s) will be unreachable. | |
iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP |
Imagine a scenario where you've been developing locally with dummy data and at some point decided to move this data to a Firebase instance.
Assuming your JSON file contents looks like the following.
[
{
"name": "Zapallo Anco",
Here are my attempts to script an IntelliJ-based IDE using javax.script.*
API (ex-JSR-223).
The list of available scripting languages and engines:
- Groovy - built-in, via Groovy jars and
<app>/lib/groovy-jsr223-xxx.jar
- JavaScript (Nashorn) - built-in, via Java Runtime
<app>/jbr/...
(deprecated and will be removed soon) - JavaScript (GraalJS) - https://plugins.jetbrains.com/plugin/12548-intellij-scripting-javascript
- JPython - https://plugins.jetbrains.com/plugin/12471-intellij-scripting-python
- JRuby - https://plugins.jetbrains.com/plugin/12549-intellij-scripting-ruby
- Clojure - https://plugins.jetbrains.com/plugin/12469-intellij-scripting-clojure
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import json | |
import os | |
import sys | |
class InvalidJSONError(ValueError): | |
def __init__(self, key, *args, **kwargs): | |
self.key = key |
VERSION="3.4.1" | |
yum -y install gcc openssl-devel | |
rm -rf Python-${VERSION}* | |
wget https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz | |
tar -xvzf Python-${VERSION}.tgz | |
cd Python-${VERSION} | |
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib" | |
echo "/usr/local/lib" > /etc/ld.so.conf.d/custom-python.conf | |
make && make altinstall |
<?php | |
// Licence: WTFPL ! http://www.wtfpl.net/about/ | |
$fbAuth = array("facebook_id" => "123456789", "facebook_token" => "<Use charles proxy to do man-in-middle SSL sniffing and extract fb token>"); | |
// Do the magic. | |
$tinderToken = tinderCall("auth", "token", $fbAuth); // Authenticate | |
$authToken = "X-Auth-Token: $tinderToken\r\nAuthorization: Token token=\"$tinderToken\"\r\n"; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.