Skip to content

Instantly share code, notes, and snippets.

@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active November 17, 2024 13:10
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@jareware
jareware / SCSS.md
Last active October 12, 2024 17:11
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@gokulkrishh
gokulkrishh / media-query.css
Last active November 10, 2024 02:00
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@mdouchin
mdouchin / PostGIS_create_missing_spatial_indexes.sql
Last active June 16, 2020 21:09
PostGIS - Function to create missing spatial indexes in your whole database
-- Allow to list all layers with no spatial index
-- To get the list
-- SELECT * FROM create_missing_spatial_indexes(True);
-- To create automatically the missing spatial indexes
-- SELECT * FROM create_missing_spatial_indexes(False);
DROP FUNCTION IF EXISTS create_missing_spatial_indexes();
DROP FUNCTION IF EXISTS create_missing_spatial_indexes( BOOLEAN );
CREATE OR REPLACE FUNCTION create_missing_spatial_indexes(simulate BOOLEAN DEFAULT FALSE)
RETURNS TABLE (
@bcks
bcks / #30DayMapChallenge.csv
Created November 30, 2019 18:37
Tweets from the #30DayMapChallenge, 2019
We can't make this file beautiful and searchable because it's too large.
id,conversation_id,created_at,date,time,timezone,user_id,username,name,place,tweet,mentions,urls,photos,replies_count,retweets_count,likes_count,hashtags,cashtags,link,retweet,quote_url,video,near,geo,source,user_rt_id,user_rt,retweet_id,reply_to,retweet_date
1200809611835707392,1192855827272675329,1575130296000,2019-11-30,11:11:36,EST,1192848641771393027,colmixe,Colmix,,"Día 30: Hogar / Tëk'äm
¿Y cómo no pensar en el territorio y las comunidades mixes sin pensar en la música?
El título de la obra musical es el título del mapa ¿Sabes cuál es?
#30daymapchallenge pic.twitter.com/RoiBym0ahe",[],[],['https://pbs.twimg.com/media/EKoh5_fWwAUNXMl.jpg'],0,0,0,['#30daymapchallenge'],[],https://twitter.com/Colmixe/status/1200809611835707392,False,,0,,,,,,,"[{'user_id': '1192848641771393027', 'username': 'Colmixe'}]",
1200807377500545024,1200807377500545024,1575129763000,2019-11-30,11:02:43,EST,2198358416,tjukanov,Topi Tjukanov,,"If I would like to do some analysis and collect basic statistics for the #30DayMapChalle