Skip to content

Instantly share code, notes, and snippets.

View devCharles's full-sized avatar
:octocat:
koding </>

Charles Silva devCharles

:octocat:
koding </>
View GitHub Profile
@scmx
scmx / jxa-ts-applescript-typescript.md
Last active December 13, 2024 05:28
How to write AppleScript JXA JavaScript in Vim or VS Code with TypeScript types #applescript #jxa #javascript #typescript #types #vim #coc

How to write AppleScript JXA JavaScript in Vim or VS Code with TypeScript types

jxa-ts-applescript-typescript

If you have written an AppleScript before, you might have felt the same way as I did, that it was a poor experience to use the Script Editor app, it's barely better than writing the script in any text editor or in a heredoc to run using osascript.

Luckily you could try the JXA variant instead, AppleScript using Javascript. But writing such a file in the Script Editor app is not a better experience sadly.

@tixastronauta
tixastronauta / facebook_leads.md
Last active April 7, 2025 17:35
Receiving Facebook Leads on a Webhook
@odlp
odlp / gist:e02621612aae82a778c2
Created August 20, 2014 09:29
Distinct substring SQL query with Postgresql
result = ActiveRecord::Base.connection.execute("SELECT DISTINCT SUBSTRING(postcode, '[A-Z0-9]{3,} [0-9]{1}') FROM postcodes")
result.values.first
# => ['AB1 1']
@soheilhy
soheilhy / nginxproxy.md
Last active April 11, 2025 06:29
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a