Skip to content

Instantly share code, notes, and snippets.

View steevhise's full-sized avatar
💭
datawranglin'

Steev Hise steevhise

💭
datawranglin'
View GitHub Profile
@elliottwilliams
elliottwilliams / README.md
Created May 12, 2019 06:40
183 issues opened during the #NoTechForICE demonstration

Since GitHub's API differentiates between deleted issues and issues that never existed, we can see how many issues were created and deleted during the #NoTechForICE demonstration.

There were at least 183 issues opened today. That's pretty cool!

Context

On 2019 May 11, tech workers were protesting Palantir's relationship with ICE by opening issues on a number of Palantir's open source libraries. ICE uses Palantir's software to coordinate the deportation of immigrant families and children in the United States. Read more at https://gist.github.com/noahzgordon/29af8c13106ddc591ccaa1ea0ce6af74.

@max-mapper
max-mapper / 0.md
Last active March 7, 2025 13:39
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@OllieJones
OllieJones / fullquery
Last active September 25, 2023 14:09
Fast nearest-location finder for SQL (MySQL, PostgreSQL, SQL Server)
SELECT zip, primary_city,
latitude, longitude, distance
FROM (
SELECT z.zip,
z.primary_city,
z.latitude, z.longitude,
p.radius,
p.distance_unit
* DEGREES(ACOS(LEAST(1.0, COS(RADIANS(p.latpoint))
* COS(RADIANS(z.latitude))
@kelvinn
kelvinn / cmd.sh
Created July 24, 2014 02:55
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@greem
greem / exim-logstash-elasticsearch-mapping
Last active February 24, 2021 16:25
exim-logstash-elasticsearch-mapping
#!/bin/bash
curl -XPUT 'http://localhost:9200/_template/exim' -d '{
"order" : 0,
"template" : "exim*",
"settings" : {
"index.refresh_interval" : "5s"
},
"mappings" : {
"deferred" : {
@greem
greem / logstash-config-exim
Last active September 1, 2021 19:41
logstash-config-exim
input {
file {
path => "/path/to/exim/mainlog"
start_position => 'beginning'
sincedb_path => "/dev/null"
}
}
filter {
@crashdump
crashdump / zbx-exim-stats.sh
Created June 3, 2013 12:25
A simple Zabbix statistics pusher. It check and report these values: - Number of running processes exim4 (trigger if 0) - Mails Queue Size (trigger if >500 and >1000) - Mails Received - Mails Error - Mails Received Size in Bytes - Mails Delivered - Mails Delivered Size in Bytes Import the template. Assign to you hosts. Cron the .sh.. You're good…
#!/bin/bash
# Set Variables
EXIMLOG=/var/log/exim4/mainlog
MYLOG=/tmp/exim_status.log
OFFSETFILE=/tmp/eximstatusoffset.dat
EXIMSTATS=/usr/sbin/eximstats
LOGTAIL=/usr/sbin/logtail
ZABBIX_SENDER=/usr/bin/zabbix_sender
ZABBIX_CONF=/etc/zabbix/zabbix_agentd.conf
@rxin
rxin / ramdisk.sh
Last active November 21, 2024 15:11
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
@steevhise
steevhise / test.txt
Created July 7, 2011 00:11
test gist
hello, world.