Skip to content

Instantly share code, notes, and snippets.

View kashifshaikh's full-sized avatar

Kashif Shaikh kashifshaikh

  • Dapper Labs
  • Toronto, Ontario, Canada
  • 20:46 (UTC -05:00)
  • X @kashifshaikh
View GitHub Profile
@slok
slok / pprof.md
Last active November 23, 2025 09:06
Go pprof cheat sheet

Enable profiling

Default http server

import (
    _ "net/http/pprof"
    "net/http"
)
@dewan-ahmed
dewan-ahmed / KRHOWT-workshop-links.md
Last active June 3, 2021 08:26
This is a gist containing helpful links for Kubernetes and OpenShift Workshop of April 21 2020 (by IBM Developer)
@jayphelps
jayphelps / redux-observable-typescript-testing-example.ts
Created February 24, 2019 05:33
Example using redux-observable + typescript + TestScheduler, with a run helper written
import { map, delay } from 'rxjs/operators';
import { TestScheduler } from 'rxjs/testing';
import { Action } from 'redux';
import { Epic, ofType, ActionsObservable, StateObservable } from 'redux-observable';
const scheduler = new TestScheduler((actual, expected) => {
if (JSON.stringify(actual) !== JSON.stringify(expected)) {
throw new Error(`Failing test
actual: ${JSON.stringify(actual, null, 2)}
let UserContext = React.createContext();
class App extends React.Component {
state = {
user: null,
setUser: user => {
this.setState({ user });
}
};
@chaosx
chaosx / config.go
Created September 20, 2017 02:13
Golang MySQL select to json
package main
var (
dbhostsip = "10.10.12.2:3306" //IP地址
dbusername = "aogooc" //用户名
dbpassword = "123456" //密码
dbname = "ops" //表名
dbcharset = "utf8"
)
import Foundation
final class Sample: NSObject {
@objc dynamic var name: String = ""
}
class MyObj: NSObject {
@objc dynamic var test: String = ""
}
extension NSObjectProtocol where Self: NSObject {
@mirzmaster
mirzmaster / learning.txt
Created August 25, 2017 21:34
Learning How To Learn
Learning How To Learn
Module 1 - What is Learning
Focused/Diffuse Modes Thinking
- Obviously ‘focused’ is when you’re concentrating. Direct approach to solving familiar problems.
- Focused: thoughts move through nicely-paved road of familiar notions (neural pattern looks very tight and directed).
- encompasses rational, sequential, analytical approaches to thinking
- Diffuse: More of a search function neural pattern. Thoughts move widely. More of a broad/big-picture perspective trying to connect ideas from different places.
- We’re always either in focused or diffuse mode of thinking.
@milankorsos
milankorsos / redux-actions.ts
Last active May 13, 2025 09:52
Correct TypeScript typing example for Redux Thunk actions
import {Action, ActionCreator, Dispatch} from 'redux';
import {ThunkAction} from 'redux-thunk';
// Redux action
const reduxAction: ActionCreator<Action> = (text: string) => {
return {
type: SET_TEXT,
text
};
};
//
// PromiseKitHelper.swift
// TrueID
//
// Created by Kittiphat Srilomsak on 3/21/2560 BE.
// Copyright © 2017 peatiscoding.me all rights reserved.
//
import PromiseKit
@brianyu0717
brianyu0717 / ThreadPoolExample.kt
Last active February 2, 2018 21:39
Using a bit of java.util.concurrent with Kotlin
// basic example of executing tasks in parallel
fun main(args: Array<String>) {
val strings = listOf("a", "b", "c")
val printStringTasks = mutableListOf<Callable<Unit>>()
strings.forEach { printStringTasks.add(Callable<Unit>({
println("starting task: $it")
Thread.sleep(2000)
println("finished task: $it")
}))}