Skip to content

Instantly share code, notes, and snippets.

View rainbow23's full-sized avatar
🏠
Working from home

rainbow23 rainbow23

🏠
Working from home
View GitHub Profile
@samuelematias
samuelematias / modal_navigation_bar.dart
Last active November 16, 2023 05:47
If you need a modal (showModalBottomSheet) but you have a bottomnavigationbar and the modal needs to be on top of the bottomnavigationbar, use the userootnavigator = true property of showModalBottomSheet.
// This example on Dartpad:
// https://dartpad.dev/cbbfed060a664b6fdaf4229b02cd1add
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@awunnenb
awunnenb / ContentView.swift
Last active October 19, 2023 21:24
SwiftUI WKWebView und WKNavigationDelegate
// YouTube Video: https://youtu.be/o52XYvwTQU0
import SwiftUI
import WebKit
struct ContentView: View {
let webView = WebView(request: URLRequest(url: URL(string: "https://www.google.com")!))
var body: some View {
VStack {
@l4u
l4u / autojump_fzf.fish
Created December 13, 2017 03:10
autojump(macOS) + fzf for fish shell
alias j="cd (cat ~/Library/autojump/autojump.txt | sort -nr | awk '{print \$2}' | fzf +s)"
@fujimisakari
fujimisakari / state_pattern.md
Last active December 1, 2020 16:28
Stateパターン

Stateパターン

HeadFirstデザインパターン Index

パターンについて

状態が変化が多数ある場合に条件分岐を使うことなく状態変化を実現できます
状態毎のオブジェクトを作っておいて、状態を変えたいときは
コンテキスト内の状態オブジェクトを変更するだけで振舞いを容易に変更できます

@fujimisakari
fujimisakari / head_first_design_pattern.md
Last active June 6, 2024 16:14
HeadFirstデザインパターン 学習メモ
@keijiro
keijiro / PbxModifier.cs
Created July 2, 2015 03:08
(Unity Xcode Manipulation API) An example which modifies compiler flags for a given source file.
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using System.IO;
public class PbxModifier
{
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
@mstevenson
mstevenson / SepScript.mel
Created November 25, 2012 22:40
Maya MEL script that breaks up a mesh based on materials. Created by Andrew Coggeshall at Basenji Games.
// Poly Separate
// Copyright (C) 2012 Basenji Games
// Licensed under the MIT license
string $selection[] = `ls -sl`;
sepMat($selection[0]);
global proc sepMat(string $object){
string $shadingGroups[] = getSGsFromShape($object);
string $ParentName = ($object + "_lightMap_Group");
@webjay
webjay / gh_hook.php
Last active January 7, 2023 11:54
Php hook script that can git pull, apc_clear_cache() etc
<?php
ignore_user_abort(true);
function syscall ($cmd, $cwd) {
$descriptorspec = array(
1 => array('pipe', 'w'), // stdout is a pipe that the child will write to
2 => array('pipe', 'w') // stderr

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@darktable
darktable / MiniJSON.cs
Created November 30, 2011 23:08
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining