Skip to content

Instantly share code, notes, and snippets.

@graydon
graydon / country-bounding-boxes.py
Created April 23, 2014 00:03
country bounding boxes
# extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip
# under public domain terms
country_bounding_boxes = {
'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)),
'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)),
'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)),
'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)),
'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)),
'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)),
@prestonp
prestonp / gist:ad5d1a3f9a026e34c44c
Last active May 13, 2024 11:40
mov to webm osx
@Omar-Ikram
Omar-Ikram / EndpointSecurityDemo.m
Last active May 13, 2024 11:38
A demo of using Apple's EndpointSecurity framework - tested on macOS Monterey 12.2.1 (21D62)
//
// main.m
// EndpointSecurityDemo
//
// Created by Omar Ikram on 17/06/2019 - macOS Catalina 10.15 Beta 1 (19A471t)
// Updated by Omar Ikram on 15/08/2019 - macOS Catalina 10.15 Beta 5 (19A526h)
// Updated by Omar Ikram on 01/12/2019 - macOS Catalina 10.15 (19A583)
// Updated by Omar Ikram on 31/01/2021 - macOS Big Sur 11.1 (20C69)
// Updated by Omar Ikram on 07/05/2021 - macOS Big Sur 11.3.1 (20E241)
// Updated by Omar Ikram on 04/07/2021 - macOS Monterey 12 Beta 2 (21A5268h)
@dfa1234
dfa1234 / npx command to run angular cli
Created May 13, 2024 11:37 — forked from ddieppa/npx command to run angular cli
This is the npx command to run angular cli new project without install it globally
npx -p @angular/cli ng new hello-world-project
then locally can run
npx ng g c hello-world-component
@Mefistophell
Mefistophell / RUST.MD
Last active May 13, 2024 11:36
How to Compile a Rust Program on Mac for Windows

Question: I want to compile my Rust source code for the Windows platform but I use macOS.

Solution:

  1. Install target mingw-w64: brew install mingw-w64
  2. Add target to rustup: rustup target add x86_64-pc-windows-gnu
  3. Create .cargo/config
  4. Add the instructions below to .cargo/config
[target.x86_64-pc-windows-gnu]
@ericbarch
ericbarch / chkraid.sh
Last active May 13, 2024 11:34
Dead simple alerts when your mdadm array degrades without setting up a full blown MTA
#!/bin/bash
# dead simple mdadm alerts via webhook
# by eric barch [v1.0 -- 2018.11.26]
# 1. place this file in ~/chkraid.sh
# chmod +x ~/chkraid.sh
# 2. drop this in your crontab:
@Verssae
Verssae / skip.js
Last active May 13, 2024 11:31
한양대학교 인권/폭력예방 교육시스템 스킵 스크립트
/**
[강의 영상 스킵]
1. 재생버튼을 눌러 한양대 로딩 영상이 끝나고(약 4초) 강의가 재생된 후 F12 버튼을 눌러 개발자 콘솔을 연 뒤 console 탭으로 이동한다.
2. 아래 스크립트를 붙여넣는다.
3. 사이트에서 나갈 것이냐고 묻는 창이 뜨면 '나가기'를 누른다.
4. 다시 영상이 로드되면 재생 버튼을 눌러 재생하고 영상 끝으로 컨트롤 버튼을 움직여 영상 시청을 완료한다.
**/
@rponte
rponte / sql_generator.sql
Created December 7, 2022 19:04
PostgreSQL: generating sample data
INSERT INTO proposal (
id, address, created_at, "document", email, "name", salary, status, updated_at
)
select
md5(random()::text || clock_timestamp()::text)::uuid as id
,'Rua das Tabajaras, ' || floor(random() * 9999)::int as address
,localtimestamp as created_at
,left(md5(random()::text), 16) as "document"
,left(md5(random()::text), 6) || '@zup.com.br' as email
,'Customer ' || left(md5(random()::text), 22) as "name"
@rponte
rponte / jaxws-enabled-logging.java
Created February 7, 2020 22:05
Enabling JAXWS request/response logging on console
/**
* Those parameters change depending on JAXWS implementation. In this case, I'm using
* Sun/Oracle implementation
*/
System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true");
System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dump", "true");
System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold", "999999");