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
// 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 / 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
@0zguner
0zguner / .eslintrc
Created January 9, 2016 21:15 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names