This file contains hidden or 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
public class DynamoEnumConverter<TEnum> : IPropertyConverter | |
{ | |
public object FromEntry(DynamoDBEntry entry) | |
{ | |
string valueAsString = entry.AsString(); | |
TEnum valueAsEnum = (TEnum)Enum.Parse(typeof(TEnum), valueAsString); | |
return valueAsEnum; | |
} | |
public DynamoDBEntry ToEntry(object value) |
This file contains hidden or 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
'use strict'; | |
const AWS = require('aws-sdk'); | |
const https = require('https'); | |
const ec2 = new AWS.EC2(); | |
const ipRangesUrl = 'https://ip-ranges.amazonaws.com/ip-ranges.json'; | |
const target = { | |
port: 5432, | |
protocol: 'tcp', |
This file contains hidden or 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 multiprocessing import Process | |
def sub(myredis, name): | |
pubsub = myredis.pubsub() | |
pubsub.subscribe(['tasks']) | |
for item in pubsub.listen(): | |
print('%s : %s' % (name, item['data'])) | |
if __name__ == "__main__": | |
# main() |
This file contains hidden or 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
Some Jenkinsfile examples |
This file contains hidden or 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
package jmeter | |
import com.excilys.ebi.gatling.core.Predef._ | |
import com.excilys.ebi.gatling.http.Predef._ | |
import com.excilys.ebi.gatling.http.Headers.Names._ | |
import bootstrap._ | |
class JMeterBenchmark extends Simulation { | |
def apply = { |
No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.
- Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
- Create or import a key -- see below for https://keybase.io
- Run
gpg --list-secret-keys
and look forsec
, use the key ID for the next step - Configure
git
to use GPG -- replace the key with the one fromgpg --list-secret-keys
This file contains hidden or 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 product.model, count(pc.model) FROM product | |
LEFT OUTER JOIN pc | |
ON product.model = pc.model | |
GROUP BY product.model; | |
SELECT model FROM product | |
WHERE model NOT IN ( | |
SELECT model FROM pc); |
This file contains hidden or 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 * FROM asterisk.cdr main | |
WHERE DATE(main.calldate) BETWEEN '2015-07-01' AND '2015-07-30' | |
AND main.record_id IN ( | |
SELECT item.record_id FROM asterisk.cdr item | |
WHERE item.calldate IS NOT NULL | |
AND HOUR(item.calldate) BETWEEN '8:00:00' AND '21:00:00' | |
); |
NewerOlder