- The Alpha (72459)
- thecodeparadox (50708)
- shiplu.mokadd.im (33490)
- taskinoor (28384)
- Imran (26188)
- StinePike (26046)
- Games Brainiac (20269) rakib (18385)
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
defmodule Extorrent.Middleware.HTTPBasicAuth do | |
def call(env, next, %{username: username, password: password} = opts) do | |
env | |
|> add_authorization_header(username, password) | |
|> Tesla.run(next) | |
end | |
defp add_authorization_header(env, username, password) do | |
auth_hash = Base.encode64(username <> ":" <> password) |
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 facebook | |
from collections import Counter | |
import requests | |
likes_counter = Counter() | |
# Get temp tokens at: https://developers.facebook.com/tools/explorer/ | |
USER_ACCESS_TOKEN = "" | |
client = facebook.GraphAPI(access_token=USER_ACCESS_TOKEN, version='2.5') |
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
# -*- coding: utf-8 -*- | |
import scrapy | |
class MySpider(scrapy.Spider): | |
name = "myspider" | |
def start_requests(self): | |
return [ | |
scrapy.Request('http://masnun.com') |
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
(ns user | |
(:use [clojure.tools.namespace.repl :only [refresh]])) | |
(defn rerun | |
[] | |
(refresh :after 'my-project.core/-main)) |
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
(defproject my-project "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:main my-project.core | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:profiles {:dev {:source-paths ["startup"]}} | |
:dependencies [[org.clojure/clojure "1.6.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
(require '[clojure.tools.namespace.repl :refer [refresh]]) | |
(refresh) | |
(-main) |
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
from subprocess import Popen, PIPE, call | |
from sys import argv, exit | |
from time import sleep | |
from os import getpid | |
def get_process_list(app): | |
ps_aux = Popen(["ps", "aux"], stdout=PIPE) | |
grep = Popen(["grep", app], stdin=ps_aux.stdout, stdout=PIPE) | |
awk = Popen(["awk", "{print $2}"], stdin=grep.stdout, stdout=PIPE) | |
ps_aux.stdout.close() |
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
{% extends 'emails/html/base.html' %} | |
{% block body %} | |
<h2 class="null" style="color: rgb(51, 51, 51); font-family: Arial, Verdana, sans-serif; line-height: 20.796875px;"><span style="font-size:14px;"><span style="line-height: 1.6em; color: rgb(32, 32, 32); font-family: Arial;">Hi <First Name>,</span></span></h2> | |
<p style="color: rgb(51, 51, 51); font-family: Arial, Verdana, sans-serif; font-size: 13px; line-height: 20.796875px;"><br /> | |
<span style="font-size:14px;">Thanks for booking at <a href="http://www.aircourts.com" target="_self">aircourts.com</a>! </span><br /> | |
</p> |
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/bash | |
# Expand globs to null when there are no matches | |
shopt -s nullglob | |
# Look for either a '<subdir>/console' or a 'symfony' file | |
until | |
file=(*/console symfony); [[ -f "$file" ]] && php "$file" "$@" && exit; | |
do | |
[[ "$PWD" == "/" ]] && break; |