Skip to content

Instantly share code, notes, and snippets.

View tectiv3's full-sized avatar
💭

tectiv3 tectiv3

💭
View GitHub Profile
@rexlow
rexlow / md
Last active April 22, 2023 16:11
Run React Native on specific iOS simulator version
To add a simulator
Choose Hardware > Device > Manage Devices.
Xcode opens the Devices window.
At the bottom of the left column, click the Add button (+).
In the dialog that appears, enter a name in the Simulator Name text field and choose the device from the Device Type pop-up menu.
//by default
@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@scottcagno
scottcagno / cmdtimeout.go
Created May 27, 2016 18:47
Golang exec.Command Timeout Wrapper
package main
import (
"bytes"
"fmt"
"os/exec"
"time"
)
func run(timeout int, command string, args ...string) string {
@rafaeltuelho
rafaeltuelho / linux-shell-docker-cli.sh
Last active August 26, 2022 10:53
Some useful shell aliases and function for Docker command line
# Docker aliases
alias di='sudo docker images'
alias dps='sudo docker ps -a'
# useful Docker functions
dock-run() { sudo docker run -i -t --privileged $@ ;}
dock-exec() { sudo docker exec -i -t $@ /bin/bash ;}
dock-log() { sudo docker logs --tail=all -f $@ ;}
dock-port() { sudo docker port $@ ;}
dock-vol() { sudo docker inspect --format '{{ .Volumes }}' $@ ;}
@mistic100
mistic100 / imageroundedrectangle.php
Last active October 27, 2021 08:47
[PHP] Draw a rectangle with rounded corners
<?php
/**
* Draw a rectangle with rounded corners.
* @param ressource &$img An image resource
* @param int $x1 Upper left x coordinate
* @param int $y1 Upper left y coordinate
* @param int $x2 Bottom right x coordinate
* @param int $y2 Bottom right y coordinate
* @param int $r Corners radius
* @param int $color A color identifier created with imagecolorallocate()
@bsphere
bsphere / timestamp.go
Last active January 23, 2024 02:50
UNIX timestamps in Golang
package timestamp
import (
"fmt"
"labix.org/v2/mgo/bson"
"strconv"
"time"
)
type Timestamp time.Time
@squarism
squarism / happy_golang_libraries.md
Last active November 4, 2017 08:57
Happy Time Golang Libraries

Happy Time Go Libraries.

Another curated list like awesome-go.
Not complete. Not authoritative. Not cupcake.
Send suggestions: @squarism :)
☆ = Github stars (in November 2016)


Adapters and Drivers

@Alex04
Alex04 / AMScanViewController.h
Last active January 4, 2023 01:46
iPhone QR Code Scanning iOS7
//
// AMScanViewController.h
//
//
// Created by Alexander Mack on 11.10.13.
// Copyright (c) 2013 ama-dev.com. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
@mbbx6spp
mbbx6spp / README.md
Last active September 29, 2019 18:37
Example usage of the dancer shell (dsh). Used as partial material for the DevOps Tech Talk Topic meetup on 8/8/2013.

Distributed or Dancer Shell

Similar to ansible command but allows you to use any command that will work in your shell. Not tied to specific configuration management tooling, just SSH and your default shell on remote systems. Just works. I <3 it :)

What does it do?

Runs commands across potentially many machines. Allows you to organize your servers/VMs/instances into groups very easily.

Getting Started

@deldrid1
deldrid1 / Squirrel Modbus CRC's
Last active January 21, 2024 09:33
Two different Methods for calculating Modbus CRC's using the Electric Imp.
//Two Different methods of calculating Modbus's CRC16
//You can use http://www.lammertbies.nl/comm/info/crc-calculation.html to verify the calculation. Change Input Mode to Hex and input the string "0103" This is for Modbus CRC's.
imp.configure ("CRC Calculation", [], []);
server.log("============ PROGRAM START =============")
/*******************************************************************************
HELPER FUNCTIONS
*******************************************************************************/
function byteArrayString(arr){
local str = ""