Skip to content

Instantly share code, notes, and snippets.

View taufikobet's full-sized avatar

Taufik Obet taufikobet

View GitHub Profile
@arikfr
arikfr / README.md
Last active August 26, 2024 19:27
Redash Query Export Tool

Setup

$ pip install click requests

Usage

$ python query_export.py --redash-url "https://app.redash.io/" --api-key ""
//
// UILabel+JumpingDots.swift
// JumpingDots
//
// Copyright (c) 2016 Arkadiusz Holko. All rights reserved.
//
import UIKit
import ObjectiveC
@dennisfarandy
dennisfarandy / swift
Created February 12, 2016 10:57
SwiftCurry
// LEARNING CURRYING
struct structA {
let a:Int
let b:Int
init(a:Int, b:Int) {
self.a = a
self.b = b
}
}
@ygotthilf
ygotthilf / jwtRS256.sh
Last active May 9, 2025 09:54
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@paulirish
paulirish / what-forces-layout.md
Last active May 8, 2025 05:49
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@dennisfarandy
dennisfarandy / ReactiveCocoaUtil.swift
Created August 5, 2015 09:31
some reactivecocoa util that colin eberhardt create, source : https://github.com/ColinEberhardt/ReactiveSwiftFlickrSearch
//
// RACSignal+Extensions.swift
// ReactiveSwiftFlickrSearch
//
// Created by Colin Eberhardt on 15/07/2014.
// Copyright (c) 2014 Colin Eberhardt. All rights reserved.
//
import Foundation
@edvinasbartkus
edvinasbartkus / gist:0e99ea8305a20737f562
Last active May 20, 2022 11:08
Ruby puma.gem install on El Capitan / Mac Sierra
gem install puma -- --with-cppflags=-I/usr/local/opt/openssl/include --with-ldflags=-L/usr/local/opt/openssl/lib
@frehulfd
frehulfd / WKInterfaceController+Reactive.h
Last active April 16, 2020 02:00
WKInterfaceController+Reactive
@import WatchKit;
#import <ReactiveCocoa/ReactiveCocoa.h>
@interface WKInterfaceController (Reactive)
@property (nonatomic, readonly) RACSignal *activatedSignal;
@property (nonatomic, readonly) RACSignal *deactivatedSignal;
@property (nonatomic, readonly) RACSignal *didPresentControllerSignal;
@property (nonatomic, readonly) RACSignal *didPushControllerSignal;
@vgeshel
vgeshel / function.js
Last active March 6, 2025 13:44
AWS Lambda function for forwarding SNS notifications to Slack
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};
@perlmunger
perlmunger / Implemenation.swift
Last active March 3, 2022 01:45
Swift NSURLSession Check File Last Modified Date With HEAD Request
func checkShouldDownloadFileAtLocation(urlString:String, completion:((shouldDownload:Bool) -> ())?) {
var request = NSMutableURLRequest(URL: NSURL(string: urlString)!)
request.HTTPMethod = "HEAD"
var session = NSURLSession.sharedSession()
var err: NSError?
var task = session.dataTaskWithRequest(request, completionHandler: { [weak self] data, response, error -> Void in
if let strongSelf = self {
var isModified = false