Skip to content

Instantly share code, notes, and snippets.

View myget.cmd
set out=c:\out\packages\%~nx1
rm -rf %out%
call dnu pack --out %out% %~1
c:\git\nuget.exe push %out%\Debug\* -ApiKey YOUR_API_KEY -Source https://www.myget.org/F/YOUR_FEED_NAME
@staff0rd
staff0rd / User.ts
Created Feb 7, 2016 — forked from masahirompp/User.ts
mongoose + typescript
View User.ts
/// <reference path="../tsd/tsd.d.ts" />
import mongoose = require('mongoose');
import passport = require('passport');
interface IUser extends mongoose.Document {
provider: string;
id: string;
authorId: string;
displayName: string;
View fix_html5gamedevs_codeblocks.sql
<?php
// CONFIG: setting this to a post id will TEST ONLY and print results for that post only
// set it to zero to process all posts
$id = 0;
// CONFIG: set to your database config
$mysqli = new mysqli("YOUR_ADDRESS_OR_IP", "YOUR_USER", "YOUR_PASSWORD", "html5forum");
// grab all posts that have <pre> blocks
$sql = "select old.topic_id, old.pid, old.post as old, new.post as new, (LENGTH(old.post) - LENGTH(REPLACE(old.post, '<pre', ''))) / LENGTH('<pre') AS cnt from forums_posts new join orig_posts old ON old.pid = new.pid WHERE (LENGTH(old.post) - LENGTH(REPLACE(old.post, '<pre', ''))) / LENGTH('<pre') > 0";
@staff0rd
staff0rd / atlas_scaler.js
Created Aug 26, 2016
Spine atlas scaler
View atlas_scaler.js
var fs = require('fs');
var linesToChange = ['size', 'xy', 'orig', 'offset']
function containsChangeLine(line) {
for(var i = 0;i < linesToChange.length; i++) {
if (line.indexOf(linesToChange[i]) > -1) {
return linesToChange[i];
}
}
View iterateWithIndex.cs
var collection = Enumerable.Repeat<Comparison>(new Comparison(), 5).ToList();
var items = Enumerable.Range(0, collection.Count).Zip(collection, (a, b) => new { Index = a, Value = b });
foreach(var item in items)
{
DoSomething(item.Value, item.Index);
}
for(var i = 0; i < collection.Count; i++)
View config
global:
scrape_interval: 30s
scrape_timeout: 10s
evaluation_interval: 30s
external_labels:
prometheus: monitoring/kube-prometheus
prometheus_replica: prometheus-kube-prometheus-0
alerting:
alert_relabel_configs:
- separator: ;
View config (without http)
global:
scrape_interval: 30s
scrape_timeout: 10s
evaluation_interval: 30s
external_labels:
prometheus: monitoring/kube-prometheus
prometheus_replica: prometheus-kube-prometheus-0
alerting:
alert_relabel_configs:
- separator: ;
View gist:e0abf53cf15e2b0aad8190dafbdc293f
$ ls -lh ~/nostalgia_data
total 140K
-rw-r--r-- 1 root root 0 Feb 17 09:26 __init__.py
drwxr-xr-x 3 root root 96 Feb 16 07:34 __pycache__
drwxr-xr-x 4 root root 128 Feb 17 11:00 cache
dr-------- 2 root root 64 Feb 17 09:32 dfs
drwxr-xr-x 467 root root 15K Feb 17 20:29 html
-rw-r--r-- 1 root root 112K Feb 17 20:29 meta.jsonl
-rw-r--r-- 1 root root 154 Feb 16 07:18 nostalgia_entry.py
@staff0rd
staff0rd / azure-pipeline.yaml
Created Sep 23, 2020
A Salesforce pipeline in Azure DevOps
View azure-pipeline.yaml
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: sfpwowerscript-installsfdx-task@5
displayName: Install SFDX
View docker-compose.yml
version: '3.2'
services:
localstack:
image: localstack/localstack:latest
container_name: localstack
ports:
- 4566:4566
environment:
- SERVICES=s3
- DEBUG=1