Skip to content

Instantly share code, notes, and snippets.

View jonathanwork's full-sized avatar

Jonathan Lopez jonathanwork

View GitHub Profile
@jonathanwork
jonathanwork / timer.swift
Created July 16, 2022 19:51
this is countdown in swift
// countdown 10 seconds
let deadlineTime = DispatchTime.now() + .seconds(15)
DispatchQueue.main.asyncAfter(deadline: deadlineTime) {
}
let deadTimeSegue = DispatchTime.now() + .seconds(60)
@jonathanwork
jonathanwork / sslScript.sh
Created April 10, 2022 00:02
adding ssl to connection
openssl genrsa -out key.pem
openssl req -new -key key.pem -out csr.pem
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
rm csr.pem
@jonathanwork
jonathanwork / connect.js
Created March 1, 2022 12:13
js connector
connector = url.URL(
{
protocol: null,
host: null ,
user: null,
password: null,
port: null,
pathname: null,
@jonathanwork
jonathanwork / go-executable-build.sh
Created September 13, 2021 13:28 — forked from DimaKoz/go-executable-build.sh
The Script to Automate Cross-Compilation for Golang(OSX)
#Before we can use the script, we have to make it executable with the chmod command:
#chmod +x ./go-executable-build.sh
#then we can use it ./go-executable-build.sh yourpackage
#!/usr/bin/env bash
package=$1
if [[ -z "$package" ]]; then
echo "usage: $0 <package-name>"
exit 1
fi
@jonathanwork
jonathanwork / restart-usb.sh
Created July 6, 2021 23:17
making usb to glitch in mac os
sudo killall -STOP -c usbd
@jonathanwork
jonathanwork / Regex.swift
Created March 5, 2018 07:05 — forked from ningsuhen/Regex.swift
Swift extension for Native String class to support Regex match and Regex replace. Credit - http://www.swift-studies.com/blog/2014/6/12/regex-matching-and-template-replacement-operators-in-swift
import Foundation
struct Regex {
var pattern: String {
didSet {
updateRegex()
}
}
var expressionOptions: NSRegularExpressionOptions {
didSet {
@jonathanwork
jonathanwork / vuesolutions.js
Created December 27, 2017 21:27
vue js workaround for runtime compiling error
resolve: {
alias: {
vue: 'vue/dist/vue.js'
}
}
@jonathanwork
jonathanwork / dockerfile
Created December 18, 2017 00:20
docker getting swift to run on linux
//makes swift run properly on linux
docker run -it --security-opt seccomp=unconfined --name swiftfun swiftdocker/swift:latest /bin/bash
@jonathanwork
jonathanwork / docker_image_start_init.sh
Last active October 27, 2017 07:26
quick docker install
dnf install httpd nginx nodejs npm php mongodb mongodb-server net-tools nmap -y
@jonathanwork
jonathanwork / connection.txt
Created October 15, 2017 20:01
beaglebone linux connection hack
BeagleBone Black:
ifconfig usb0 192.168.7.2
route add default gw 192.168.7.1
Host PC:
sudo su
#eth0 is my internet facing interface, eth3 is the BeagleBone USB connection