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
<?php | |
/* | |
░░░░░░░░░▄░░░░░░░░░░░░░░▄░░░░ | |
░░░░░░░░▌▒█░░░░░░░░░░░▄▀▒▌░░░ | |
░░░░░░░░▌▒▒█░░░░░░░░▄▀▒▒▒▐░░░ | |
░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐░░░ | |
░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐░░░ | |
░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌░░░ | |
░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌░░ |
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
<?php | |
# based on https://gist.github.com/alexstone/9319715 | |
function slack_post($post_id) { | |
if( ( $_POST['post_status'] == 'publish' ) && ( $_POST['original_post_status'] != 'publish' ) ) { | |
$room = "general"; // What Slack channel to send to | |
$post = get_post($post_id); | |
$author = get_userdata($post->post_author); | |
$message = "New post '" . get_the_title($post_id) . "' by {$author->user_firstname} - " . get_permalink($post->ID); |
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
sudo: required | |
language: node_js | |
node_js: | |
- 5.0.0 | |
services: | |
- docker | |
install: true | |
script: | |
- echo "Hey" | |
deploy: |
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
The Expanse | |
Childhood's End | |
One Punch Man | |
The Magicians | |
Narcos | |
Jessica Jones | |
House of Cards | |
Peaky Blinders | |
Bloodline | |
Con Man |
<div>This is stuffed into the <body></div>
<p>Also this</p>
alert("yolo"); // this gets executued
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 Html exposing (li, text, ul) | |
import Html.Attributes exposing (class, href) | |
{-| This snippet uses the <ul> and <li> tags to create an unorderd | |
list of French grocery items. Notice that all occurrences of 'ul' | |
and 'li' are followed by two lists. The first list is for any HTML | |
attributes, and the second list is all the HTML nodes inside the | |
tag. |
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
app.post('/upload', multipartMiddleware, (req, res) => { // multipartMiddleware is for multipart forms | |
console.log(req.body); | |
res.json({ | |
foo: 'bar', | |
}); | |
}); |
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
User.defineStatic('validate', async function validateUser(email, password) { | |
const user = await User.getAll(email, { index: 'email' }).run(); | |
if (user.length !== 1) { | |
throw new Error('No user found'); | |
} | |
if (!compare(password, user[0].password)) { | |
throw new Error('Wrong password'); | |
} | |
return true; | |
}); |
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 fetch from 'node-fetch'; | |
const channel = 'C03T4C7MS'; | |
const channelInfoUrl = `https://slack.com/api/channels.info?token=${token}&channel=${channel}`; | |
const userListUrl = `https://slack.com/api/users.list?token=${token}`; | |
async function fetchUsers() { | |
try { | |
let usersInChannel = await fetch(channelInfoUrl).then(res => res.json()); | |
usersInChannel = usersInChannel.channel.members; |
OlderNewer