Skip to content

Instantly share code, notes, and snippets.

View knxroot's full-sized avatar

Gustavo Lacoste knxroot

View GitHub Profile
@henrysher
henrysher / reinvent.md
Last active July 9, 2021 07:38
link for reinvent slides
@WebReflection
WebReflection / certificate.sh
Last active July 1, 2020 18:08
A basic Self Signed SSL Certificate utility
#!/usr/bin/env bash
# A basic Self Signed SSL Certificate utility
# by Andrea Giammarchi @WebReflection
# https://www.webreflection.co.uk/blog/2015/08/08/bringing-ssl-to-your-private-network
# # to make it executable and use it
# $ chmod +x certificate
# $ ./certificate # to read the how-to
@revolunet
revolunet / ffmpeg-tips.md
Last active October 6, 2023 17:47
ffmpeg tips

libcaca output from your OSX webcam

ffmpeg -f avfoundation -framerate 30 -s "640x480" -i "0" -c:v rawvideo -pix_fmt rgb24 -f caca -s "640x480" output4.mp4

brew install ffmpeg with options

brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-libcaca

convert to another format, resize withouth quality loss

ffmpeg -i vitrine.mp4 -vf scale=1024:-1 -q:vscale 0 vitrine.avi

@phrawzty
phrawzty / 2serv.py
Last active April 24, 2024 15:02
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@mountaindude
mountaindude / date_variables.qvs
Last active January 23, 2018 10:43
QlikView and Qlik Sense date variables
let vStartOf2ndPreviousQuarter = Date(Floor(QuarterStart(Today(), -2)), 'YYYY-MM-DD');
let vStartOf2ndPreviousQuarterNum = Num(Date(Floor(QuarterStart(Today(), -2)), 'YYYY-MM-DD'));
let vStartOfPreviousQuarter = Date(Floor(QuarterStart(Today(), -1)), 'YYYY-MM-DD');
let vStartOfPreviousQuarterNum = Num(Date(Floor(QuarterStart(Today(), -1)), 'YYYY-MM-DD'));
let vStartOfCurrentQuarter = Date(Floor(QuarterStart(Today())), 'YYYY-MM-DD');
let vStartOfCurrentQuarterNum = Num(Date(Floor(QuarterStart(Today())), 'YYYY-MM-DD'));
let vStartOfPreviousMonth = Date(Floor(MonthStart(Today(), -1)), 'YYYY-MM-DD');
@flcdrg
flcdrg / boxstarter-bare-v3.ps1
Last active March 25, 2024 01:47
My BoxStarter Scripts
# 1. Install Chocolatey
<#
Set-ExecutionPolicy RemoteSigned -Force
# Create empty profile (so profile-integration scripts have something to append to)
if (-not (Test-Path $PROFILE)) {
$directory = [IO.Path]::GetDirectoryName($PROFILE)
if (-not (Test-Path $directory)) {
New-Item -ItemType Directory $directory | Out-Null
}
@hiilppp
hiilppp / title_case.py
Created August 16, 2014 12:11
Python script for capitalizing titles (according to The Chicago Manual of Style's rules) in Editorial (see http://www.editorial-workflows.com/workflow/5247248250175488/_f57rqO3mos).
# -*- coding: utf-8 -*-
import linguistictagger
import re
import workflow
def capitalize_(s):
if re.search(r"[A-Z]", s):
return s
else:
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@wadewegner
wadewegner / upload_rest.py
Last active October 20, 2022 05:59
Upload attachment to Salesforce using Python
import requests
import base64
import json
from simple_salesforce import Salesforce
userName = ''
password = ''
securityToken = ''
instance = ''
@andyfowler
andyfowler / gist:10281760
Created April 9, 2014 15:13
Check if your RapidSSL cert is revoked in their OCSP server
# download the rapidssl intermediate bundle
curl https://knowledge.rapidssl.com/library/VERISIGN/ALL_OTHER/RapidSSL%20Intermediate/RapidSSL_CA_bundle.pem > rapidssl-bundle.pem
# check if your (presumably revoked) cert is revoked via its OCSP server
# this OCSP url is also in your cert, in the Authority Information Access section
openssl ocsp -issuer rapidssl-bundle.pem -cert YOURCERT.crt -url http://rapidssl-ocsp.geotrust.com