Skip to content

Instantly share code, notes, and snippets.

View RosayGaspard's full-sized avatar
🪐
Travelling the universe.

Gaspard Rosay RosayGaspard

🪐
Travelling the universe.
View GitHub Profile
@RosayGaspard
RosayGaspard / CopyFilesThenMove.bat
Last active October 20, 2016 09:27
This is a (very) small script to copy files to another directory (like a shared one) and then move it in another directory
@echo off
REM This script will copy all CSV files of the given directory to another location
REM Then it moves files to another directory
xcopy C:\path\to\files\*.csv Z:\path\to\copied\files\ /y
move C:\path\to\files\*.csv C:\path\to\new\location\ /y
@RosayGaspard
RosayGaspard / objectToArray.php
Last active October 20, 2016 09:33
Convert an object into an array (by example json object)
<?php
/**
* Convert an object into an array (by example json object)
* @param an object
* @return an array
*/
function objectToArray($object) {
if(is_object($object)) {
$object = get_object_vars($object);
# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a password
# open user:password@example.com
# Connect
@RosayGaspard
RosayGaspard / solarized-dark.reg
Created April 10, 2018 08:55 — forked from noelbundick/LICENSE
Solarized Dark for Bash on Windows - Debian version
Windows Registry Editor Version 5.00
; Adapted from https://github.com/neilpa/cmd-colors-solarized/blob/master/solarized-dark.reg
; Registry file that maps the solarized palette to the 16 avaliable colors
; in a Windows command prompt. Note, hex values in the table are RGB but byte
; ordering of a DWORD is BGR, e.g. "ColorTable<##>"=dword:00<B><G><R>
;
; Solarized color table from http://ethanschoonover.com/solarized.
;
@RosayGaspard
RosayGaspard / .hyper.js
Last active April 25, 2018 09:44
Hyper configuration file to use with WSL
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@RosayGaspard
RosayGaspard / PlayerMovement.cs
Created January 23, 2019 14:52
Custom 3rd person character controller for Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour {
private CharacterController characterController;
private Animator animator;
private float moveSpeed;
private bool hasJumped;
@RosayGaspard
RosayGaspard / swiftui-view-fullwidth.swift
Created January 22, 2020 08:25
Frame setting to make view take full width in SwiftUI
Text("My text")
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
struct LoginView: View {
@State private var username: String = ""
@State private var password: String = ""
var body: some View {
GeometryReader { geometry in
VStack{
Image("lock")
.resizable()
struct ContentView: View {
var body: some View {
VStack{
Image("lock")
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 200.0, height: 200.0)
.cornerRadius(90.0)
Text("I am protected by a login page.")
}
@RosayGaspard
RosayGaspard / CameraController.swift
Created January 28, 2020 09:13
Simple camera controller to show the front camera in Swift
class CameraController: NSObject{
var captureSession: AVCaptureSession?
var frontCamera: AVCaptureDevice?
var frontCameraInput: AVCaptureDeviceInput?
var previewLayer: AVCaptureVideoPreviewLayer?
enum CameraControllerError: Swift.Error {
case captureSessionAlreadyRunning
case captureSessionIsMissing
case inputsAreInvalid