Skip to content

Instantly share code, notes, and snippets.

@0zguner
0zguner / sst.config.ts
Created May 6, 2025 13:42 — forked from prutya/sst.config.ts
Deploy a Next.js app to a Hetzner VPS using SST and Docker (Part of my SST guide https://www.prudkohliad.com/articles/deploy-next-js-to-vps-using-sst-2024-08-11). See full repo at https://github.com/prutya/next-self-hosted
/// <reference path="./.sst/platform/config.d.ts" />
import { resolve as pathResolve } from "node:path";
import { writeFileSync as fsWriteFileSync } from "node:fs";
import { asset as pulumiAsset, all as pulumiAll } from "@pulumi/pulumi";
// Specify HCLOUD_TOKEN and CLOUDFLARE_API_TOKEN before running
// Permissions for CLOUDFLARE_API_TOKEN:
// - Account Settings:Read
// - Zone Settings:Edit
@0zguner
0zguner / xcode.sublime-build
Created October 10, 2021 12:35
Build system for running Openframeworks xcode projects inside sublime text
{
"working_dir": "${project_path:${folder}}",
"shell_cmd": "if pgrep ${project_base_name} &> /dev/null ; then pkill ${project_base_name} ; fi && make && sleep 1 && open ${project_path:${folder}}/bin/${project_base_name}.app",
"file_regex": "^(.*):([0-9]*):[0-9]*:[fatal ]+error: ",
"selector": "source.c++",
"variants": [
{
"name": "Build & Run (macOS)",
"working_dir": "${project_path:${folder}}",

Keybase proof

I hereby claim:

  • I am mzgnr on github.
  • I am mzgnr (https://keybase.io/mzgnr) on keybase.
  • I have a public key whose fingerprint is BD50 74D5 A9F2 1B89 F778 6628 5FFA C530 685F 1082

To claim this, I am signing this object:

// anwswer to http://stackoverflow.com/questions/41915285/polling-with-rxswift-and-parse-server
func myObs() -> Observable<Int> {
return Observable<Int>.create { observer in
let sig = Observable<Int>.interval(1.0, scheduler: MainScheduler.instance)
let subscription =
sig.subscribe(onNext: { num in
observer.onNext(num)
if num == 10 {
@0zguner
0zguner / gist:b163f957c82189d43f8a968a56892c58
Created April 29, 2017 14:57 — forked from kaiix/gist:4070967
Add dotted/dashed border to a UITableViewCell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
if (!cell) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier] autorelease];
}
@0zguner
0zguner / ViewController.swift
Created April 28, 2017 20:35 — forked from tikipatel/ViewController.swift
Auto-expanding UITableViewCell
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.tableView.estimatedRowHeight = 44
@0zguner
0zguner / SelfSizingTextViewTableCell.swift
Created April 28, 2017 18:15 — forked from nemotoo/ SelfSizingTextViewTableCell.swift
SelfSizing TableViewCell with Swift 2.0 Beta Raw
// References
// https://github.com/damienpontifex/BlogCodeSamples/tree/master/SelfSizingTextViewTableCell
// https://pontifex.azurewebsites.net/self-sizing-uitableviewcell-with-uitextview-in-ios-8/
//
// In UITableViewController
// tableView.rowHeight = UITableViewAutomaticDimension;
// tableView.estimatedRowHeight = DefaultCellHeight;
//
import UIKit
@0zguner
0zguner / UINavigationBar.swift
Created April 19, 2017 13:57
Remove UINavigationBar bottom line
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
@0zguner
0zguner / init.el
Created July 23, 2016 12:46 — forked from mjason/init.el
react native emacs setting
;; please install web-mode
;; in your .emacs.d/init.el
(add-to-list 'auto-mode-alist '(".*/react/.*\\.js[x]?\\'" . web-mode))
(setq web-mode-content-types-alist
'(("jsx" . "/.*/react/.*\\.js[x]?\\'")))
.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js