Skip to content

Instantly share code, notes, and snippets.

@nickbudi
nickbudi / README.md
Last active February 17, 2024 14:25
Budi's Counter-Strike: Global Offensive config

Budi's CS:GO Config

This is my constantly updated CS:GO autoexec config. Changelogs can be found under revisions here

Put autoexec.cfg in ...\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg or take what you want from it and add to your autoexec config!

After the Wild West Simulator 2015 update, video.txt needs to be put in ...\Steam\userdata\<Steam3 ID>\730\local\cfg

Launch Options

@solepixel
solepixel / dynamic-pricing-table.php
Last active April 20, 2018 19:11
dynamic pricing table
<?php
function display_dynamic_pricing_table(){
global $post;
# see line 42 of woocommerce_pricing_by_product.class.php
$pricing_rule_sets = get_option('_a_category_pricing_rules', array());
$found = false;
if(count($pricing_rule_sets)){
global $woocommerce_pricing;
foreach ($pricing_rule_sets as $pricing_rule_set) {
//
// SCNVector3+MathUtils.swift
//
// Created by Jeremy Conkin on 4/26/16.
//
import SceneKit
/**
Add two vectors
@jarretmoses
jarretmoses / React Native Clear Cache
Last active March 11, 2024 10:20
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@andymatuschak
andymatuschak / States-v3.md
Last active May 1, 2024 12:32
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

@pjechris
pjechris / Appfile
Last active May 24, 2022 17:46
fastlane
# you can even provide different app identifiers, Apple IDs and team names per lane:
# More information: https://github.com/fastlane/fastlane/blob/master/docs/Appfile.md
app_identifier ENV["APP_IDENTIFIER"] # The bundle identifier of your app
# You will have to set APP_IDENTIFIER into your .env files
apple_id ENV["APPLE_ID"] # Your Apple email address
team_id ENV["TEAM_ID"] # Developer Portal Team ID
@IanKeen
IanKeen / Example.swift
Last active March 1, 2023 18:15
Lightweight styling setup using UIAppearance
import PlaygroundSupport
// using constrained static members on `Style` we can create presets
extension Style where T: UIButton {
static var global: Style<UIButton> {
return .init { button in
button.backgroundColor = .blue
button.setTitleColor(.red, for: .normal)
}
}
@vegather
vegather / BlurryOverlayView.swift
Last active February 26, 2024 16:06
A simple view to animate in and out a blurry overlay. Use .blurIn() and .blurOut() to animate the blur. User interaction is passed through when the view is not blurry. NOTE: If you use storyboards, you need to drag out a UIVisualEffectView and set the class. It doesn't work if you drag out a plain old UIView.
class BlurryOverlayView: UIVisualEffectView {
private var animator: UIViewPropertyAnimator!
private var delta: CGFloat = 0 // The amount to change fractionComplete for each tick
private var target: CGFloat = 0 // The fractionComplete we're animating to
private(set) var isBlurred = false
private var displayLink: CADisplayLink!
override init(effect: UIVisualEffect?) {
super.init(effect: effect)
setup()
@kean
kean / AutoRetry.swift
Last active September 20, 2023 20:21
Smart Auto Retry using RxSwift
// The MIT License (MIT)
//
// Copyright (c) 2017 Alexander Grebenyuk (github.com/kean).
import Foundation
import RxSwift
import RxCocoa
extension ObservableType {
@antonyalkmim
antonyalkmim / HttpService+Rx.swift
Last active November 24, 2022 21:42
A URLSession approach to organize Network layer
import Foundation
import RxSwift
extension HttpService: ReactiveCompatible { }
extension Reactive where Base: HttpServiceType {
func request(_ endpoint: Base.Target) -> Single<Data> {
return Single<Data>.create(subscribe: { [weak base] single in
let task = base?.request(endpoint, responseData: { result in