Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
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
*~ | |
*.pyc | |
.vagrant | |
venv |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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 python | |
""" | |
2020 update: | |
- More iterators, fewer lists | |
- Python 3 compatible | |
- Processes files in parallel | |
(one thread per CPU, but that's not really how it works) | |
""" |
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
var Mocha = require('mocha'), | |
expect = require('chai').expect; | |
var mocha = new Mocha({ | |
reporter: 'spec' | |
}); | |
var dashboards = Mocha.Suite.create(mocha.suite, 'dashboards'); | |
var subsuite = Mocha.Suite.create(dashboards, 'something'); |
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 Yale VPN uses Cisco AnyConnect. | |
If Cisco's Linux client works for you, congratulations. | |
If, like me, the official client leaves you stranded, then you need to install | |
OpenConnect and (assuming you are using Network Manager) the appropriate add-on for the NM applet. | |
On a Debian-based system, you can type the following command: | |
$ sudo apt-get install openconnect network-manager-openconnect network-manager-openconnect-gnome |
The goal is to create or generate some files in the user's app directory, so that he can make some uses of it. For instance, provide LESS
files that uses end-user's LESS variables (eg. the user's custom bootstrap theme).
This gist is just explaining the method Marco Pfeiffer has found to make its (awesome) highly configurable LESS boostrap package.
In order to create some file in the user's app workspace, you need to create a build plugin with the registerBuildPlugin
API. Then you need to get it called at least once during build. This is done by registering a sourceHandler
on some file extension. Your build plugin we get called once per file matching the extension. For now only one build plugin can register as a handler for a given extension
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 python | |
import os | |
import re | |
import daemon | |
import asyncore | |
import smtpd | |
class SimpleRelayService(smtpd.PureProxy): | |
"""Handles processing mail for relay""" |
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
# Inspired from http://coding4streetcred.com/blog/post/Asymmetric-Encryption-Revisited-(in-PyCrypto) | |
# PyCrypto docs available at https://www.dlitz.net/software/pycrypto/api/2.6/ | |
from Crypto import Random | |
from Crypto.PublicKey import RSA | |
import base64 | |
def generate_keys(): | |
# RSA modulus length must be a multiple of 256 and >= 1024 | |
modulus_length = 256*4 # use larger value in production |
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
ikev2 "inet" passive ipcomp esp \ | |
from 0.0.0.0/0 to 10.0.1.0/24 \ | |
from 10.0.0.0/24 to 10.0.1.0/24 \ | |
local egress peer any \ | |
srcid egress \ | |
psk "strong-password" \ | |
config protected-subnet 0.0.0.0/0 \ | |
config address 10.0.1.0/24 \ | |
config name-server 10.0.0.1 \ | |
tag IKED |
OlderNewer