Skip to content

Instantly share code, notes, and snippets.


Ron Lobo ronlobo

View GitHub Profile
ronlobo /
Last active February 14, 2020 17:33
Rust Fearless SIMD bundled for Codingame -
pub mod fallback {
use std::ptr;
use crate::traits::{SimdF32, SimdMask32};
impl SimdF32 for f32 {
type Raw = f32;
type Mask = u32;
ronlobo /
Last active February 14, 2020 16:44
Codingame thread performance test, tl;dr unthreaded runs ~2.5x faster
use std::sync::{Mutex, Arc};
use std::thread;
use std::time::Instant;
fn main() {
let threaded_counter = Arc::new(Mutex::new(0));
let mut handles = vec![];
let timer = Instant::now();
for _ in 0..2 {
ronlobo / cpuinfo
Created February 14, 2020 15:43
Codingame CPU architecture with "cat /proc/cpuinfo 1>&2"
View cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel Core Processor (Haswell, no TSX)
stepping : 1
microcode : 0x1
cpu MHz : 2194.834
cache size : 4096 KB
physical id : 0
ronlobo /
Last active February 12, 2020 18:25
Genetic solution for Codingame Marslander v2 puzzle in Rust - heavily inspired by
pub mod env {
#[derive(Copy, Clone, Debug, PartialOrd, PartialEq)]
pub enum EnvOption {
pub const ENV: EnvOption = EnvOption::PROD;
pub fn is_prod() -> bool {
ronlobo / Blueprint.php
Created November 8, 2017 18:02 — forked from m4grio/Blueprint.php
Extending Laravel 5 Blueprint for MySqlConnection
View Blueprint.php
namespace App\Database\Schema;
use Illuminate\Database\Schema\Blueprint as ParentBlueprint;
use Illuminate\Support\Facades\DB;
* Class Blueprint
ronlobo / The Technical Interview Cheat
Created May 23, 2017 14:54 — forked from tsiege/The Technical Interview Cheat
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
ronlobo / string_format_function.dart
Created May 9, 2017 15:00
String format for Dart
View string_format_function.dart
static String format(String fmt,List<Object> params) {
int matchIndex = 0;
String replace(Match m) {
if (matchIndex<params.length) {
switch (m[4]) {
case "f":
num val = params[matchIndex++];
String str;
if (m[3]!=null && m[3].startsWith(".")) {
str = val.toStringAsFixed(int.parse(m[3].substring(1)));
View mars_lander_optimization.dart
import 'dart:io';
import 'dart:math';
import 'dart:collection';
Line marsGround;
State marsLanderInitState;
// todo set you hostname for debugging
List<String> localHosts = [];
ronlobo /
Created February 25, 2015 06:55
when git rm --cached -r doesn't work
git filter-branch --force --index-filter \
'git rm -r --cached --ignore-unmatch $1' \
--prune-empty --tag-name-filter cat -- --all
ronlobo /
Last active August 29, 2015 14:15 — forked from t-io/
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL"