Skip to content

Instantly share code, notes, and snippets.

@swayducky
swayducky / cursor
Last active February 13, 2025 09:14
This fixes using "cursor" command in WSL
#!/usr/bin/env sh
# LATEST VERSION OF THIS SCRIPT: https://gist.github.com/swayducky/8ba8f2db156c7f445d562cdc12c0ddb4
# FORKED FROM: https://gist.github.com/ddwang/0046da801bcb29d241869d37ad719394
# 1) No longer has a hard-coded COMMIT
# 2) Auto-symlinks a "code" script to avoid wslCode.sh breaking
# HOW TO INSTALL:
# 1) Remove "c:\Users\<USER_NAME>\AppData\Local\Programs\cursor\resources\app\bin" from Windows Environment Settings
# 2) Modify this script with your Windows <USER_NAME> (NOT your WSL username) in the VSCODE_PATH variable
@Edudjr
Edudjr / prettyPrint.swift
Created February 9, 2017 12:45
Swift 3 JSON pretty printing
//Function to pretty-print Json Object in Swift 3
func prettyPrint(with json: [String:Any]) -> String{
let data = try! JSONSerialization.data(withJSONObject: json, options: .prettyPrinted)
let string = NSString(data: data, encoding: String.Encoding.utf8.rawValue)
return string as! String
}
@jplazcano87
jplazcano87 / validator.swift
Last active January 16, 2023 23:44
Rut validator chile
import Foundation
enum RutError: ErrorType{
case InvalidRut(message : String)
}
class FormValidator: NSObject {
static func validateRut(value : String) throws ->String {
//clean rut
@mau21mau
mau21mau / README.md
Last active March 23, 2025 23:26
Configure Celery + Supervisor With Django
@cdownie
cdownie / gist:1039380
Created June 22, 2011 02:09
html redirect
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=http://site.com">
<script language="javascript">
window.location.href = "http://site.com"
</script>
<title></title>
</head>