Skip to content

Instantly share code, notes, and snippets.

View rhalff's full-sized avatar

Robbert Halff rhalff

  • Robbert Halff
  • Netherlands
View GitHub Profile
@escamoteur
escamoteur / nextField.dart
Created September 13, 2019 12:22
So easy is it now to implement a next field behavior for forms, meaning that the focus is moved as soon the user tabs the next button on the keyboard
class _MyHomePageState extends State<MyHomePage>
with SingleTickerProviderStateMixin {
TabController _tabController;
FocusScopeNode _node = FocusScopeNode(); /// <-----------------
@override
void initState() {
_tabController = TabController(length: 3, vsync: this);
@shivampandey0
shivampandey0 / main.dart
Created August 15, 2019 16:11
Simple code snippet for Indian Flag (Add ashok_chakra.png in assets)
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: HomeScreen(),
));
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
@sma
sma / example.dart
Last active July 12, 2023 03:00
A flutter example demonstrating a custom painter drawing selectable rects
// run in DartPad: <https://dartpad.dev/c6a9111d58c3deb83711106cec6152ee>
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(home: RectsExample()));
}
class RectsExample extends StatefulWidget {
@override
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Font
:set guifont=Source\ Code\ Pro:h14
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Hide pointless junk at the bottom, doesn't work in .vimrc for some reason?
:set laststatus=0
:set noshowmode "don't show --INSERT--
:set noruler "don't show line numbers/column/% junk
@juanpicado
juanpicado / org.verdaccio.launcher.plist
Last active June 7, 2023 19:06
verdaccio on mac as a service
# ~/Library/LaunchAgents/org.verdaccio.launcher.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.verdaccio.launcher</string>
<key>Program</key>
<string>/Users/user/Scripts/verdaccio.sh</string>
<key>RunAtLoad</key>
@ErikAugust
ErikAugust / spectre.c
Last active April 15, 2024 13:55
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@pgherveou
pgherveou / iPhone Model Mapping.txt
Last active July 22, 2020 00:45
iPhone Model Mapping.txt
Source https://stackoverflow.com/questions/11197509/how-to-get-device-make-and-model-on-ios
@"iPhone1,1" on iPhone
@"iPhone1,2" on iPhone 3G
@"iPhone2,1" on iPhone 3GS
@"iPhone3,1" on iPhone 4 (GSM)
@"iPhone3,3" on iPhone 4 (CDMA/Verizon/Sprint)
@"iPhone4,1" on iPhone 4S
@"iPhone5,1" on iPhone 5 (model A1428, AT&T/Canada)
@"iPhone5,2" on iPhone 5 (model A1429, everything else)
// d8 --expose-gc --allow-natives-syntax --track-retaining-path weak-value-retaining-path.js
class SomeKey {
}
class Metadata {
constructor() {
this.large = new LargeObject();
}
}
@mstfydmr
mstfydmr / scan_recursive.go
Last active December 9, 2022 01:02
Go Lang - Scan Folder Recursive. Find all files and folders.
package main
import (
"fmt"
"os"
"path/filepath"
"strings"
"log"
)
@JamieMason
JamieMason / migrate-to-lerna.sh
Last active April 25, 2019 18:58
Bash script to migrate multiple projects into one Lerna monorepo (https://lernajs.io)
#!/usr/bin/env bash
set -x
shopt -s extglob dotglob
cd "$HOME"
rm -rf "$HOME/TEMP_DIR"
mkdir "$HOME/TEMP_DIR"
cd "$HOME/TEMP_DIR"
git init