Skip to content

Instantly share code, notes, and snippets.

@luqmaan
luqmaan / write_to_clipboard.py
Last active April 5, 2023 16:35
Write a python string to the clipboard via pbcopy (OS X)
def write_to_clipboard(output):
import subprocess
process = subprocess.Popen('pbcopy', env={'LANG': 'en_US.UTF-8'}, stdin=subprocess.PIPE)
process.communicate(output.encode())
body {
font-family: "Comic Sans MS";
background-color: #FFB057!important;
background-image: url("//d.thumbs.redditmedia.com/hn64UDlHB1-7n1C9.png");
content: "oh man i am not good with computer plz to help";
text-transform: uppercase;
font-size: 25px!important
}
h1 {
color: green!important;
SONGS=(1099 1427 541 1426 270 479 265 413 268 269 267 266 263 262 261 260 259 258 257 256 255 254 253 252 250 249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222)
# SONGS=(1099 )
for SONG_ID in ${SONGS[@]}; do
echo "hi $i"
URL=$(
curl "https://www.hive.co/downloads/page/35/popup/modal/?download_id=$SONG_ID" \
| grep "window.NEXT_URL" \
| grep -o -E "'http:.*'" \
| sed "s/'//g"
)
{
"white": false,
"indent": 4,
"onecase": false,
"onevar": false,
"immed": true,
"debug": false,
"evil": false,
"strict": false,
"multistr": false,
@luqmaan
luqmaan / luq.zsh-theme
Last active August 29, 2015 14:23
Like simple.zsh-theme, but with the time and return code. Now with git-radar.
source ~/dev/gits/git-radar/radar-base.sh
PROMPT='%{$fg[black]%}%* %? %~ $(git_prompt_info) $(zsh_color_changes_status | xargs)
%{$fg[green]%}%1d %{$fg[black]%}$ %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX=""
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[green]%}✔%{$reset_color%}"
var extent = turf.extent(this.props.parkGeo);
var bounds = [
[extent[0], extent[1]],
[extent[2], extent[3]],
];
@luqmaan
luqmaan / request-when-example.js
Last active August 29, 2015 14:22
Use request/request and when.js together
import when from 'when';
import rw from './request-when';
return rw({
uri: '/howdy',
method: 'get',
})
.tap((body) => console.log('hai', body))
.catch((err) => console.error(err));
import json
import psycopg2
conn = psycopg2.connect("dbname='bostongreenmap' user='django' host='localhost' password='django'")
cursor = conn.cursor()
with open('./data/city_of_austin_parks.json', 'r') as fh:
data = fh.read()
@luqmaan
luqmaan / output.sql
Last active August 29, 2015 14:22
Transform EPSG 2277 into normal latitude and longitude. Used with Austin's Parks and Recreation park data. Uses PostGIS
POLYGON((-97.7687362778002 30.3717650351804,-97.768874049635 30.37169765521,-97.7692586673678 30.3715035247484,-97.7692652959938 30.3712927241672,-97.7692689401395 30.3711767965393,-97.7691567890296 30.3700707061847,-97.7696624503949 30.3697197483224,-97.7696878711314 30.369743111801,-97.7697144892603 30.3697583862574,-97.7697440930412 30.3697686862194,-97.7697754888891 30.3697736584759,-97.769792786984 30.3697733184167,-97.7698073842607 30.3697730317559,-97.7698224757268 30.369770047947,-97.7698384731024 30.3697668864334,-97.7698518705641 30.3697616264478,-97.7699310336165 30.3701926741441,-97.7697306441092 30.3704822675733,-97.769610264213 30.3707748368802,-97.7696057520131 30.3710638901788,-97.7695281780238 30.3713284346645,-97.769442100388 30.3713889260538,-97.7693321719845 30.3718848706923,-97.7693698240369 30.3719898067316,-97.7695186565339 30.3723881433225,-97.7694357653889 30.3725423479022,-97.7693561907433 30.3725038488624,-97.7693241006164 30.3725475421472,-97.7690220719379 30.3726333114381,-97.7690
* /
function() {
var e, t, n;
di.provide("di.ui.CanvasBlur"), t = [512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465