Skip to content

Instantly share code, notes, and snippets.

View JohannMG's full-sized avatar
🐺

Johann Garces JohannMG

🐺
View GitHub Profile
@JohannMG
JohannMG / main.cpp
Created September 23, 2020 02:21
Test if QMap sorts strings by alphabetical order ( Yes it Does
#include <QCoreApplication>
#include <QDebug>
#include <QMap>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
@JohannMG
JohannMG / main.cpp
Created March 3, 2020 01:19
Testing URL Parsing for Base64 URL Query Parameters in Node and Qt Framework using QUrl abd QUrlQuery
#include <QCoreApplication>
#include <QUrl>
#include <QDebug>
#include <QUrlQuery>
#include <QPair>
#include <QString>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
@JohannMG
JohannMG / SnipClip.py
Last active November 8, 2019 20:43
Friend asked me how we could do a live stream with the Live but not the "stream": there was little to no reliable internet connection. I wrote this in a few hours
from moviepy.editor import VideoFileClip
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
import os.path
import sys
import time
import math
import ffmpy
'''
from moviepy.editor import VideoFileClip
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
import os.path
import sys
import time
import math
def main(args):
clipCount = 0
# # clip = VideoFileClip("/Users/johannmg/localdev/LiveVidSnipets/recordin/2019-11-04_18-56-06.flv")
@JohannMG
JohannMG / DiceProblem.swift
Created June 2, 2017 21:47
Dice that hit a 5 or 6 can be re-rolled to doubled-down. Three dice are rolled. What's the the probability of getting 2 or more total points.
//: Playground - noun: a place where people can play
import Cocoa
/*
Problem: There are three dice.
It counts as a point if any die hits a 5 or 6
Any die that gets a 5 ot 6 is rolled again. If the second roll is 5 ot 6 that die has produced two points.
*/
@JohannMG
JohannMG / EmojiStrings.swift
Last active May 2, 2017 16:23
Playground figuring out emoji String encoding.
//: Playground - noun: a place where people can play
import UIKit
extension Character
{
func unicodeScalarCodePoint() -> String
{
let characterString = String(self)
@JohannMG
JohannMG / CollectionOnlyType.swift
Created May 2, 2017 00:02
I write this so much. Saved.
import Foundation
extension Collection {
func onlyType<T>(_ type: T.Type) -> [T] {
return self.filter{ $0 is T }.map{ $0 as! T }
}
}

Make A CCMFramework Build inside AAAMobile.

Version update

if needed

  • Update Version Number in CCMVersion.swift
  • Update Version Number in CCMFramework.h comments/header
  • Update Version Number in info.plist info.plist update
@JohannMG
JohannMG / HackernewsYouCanUse.css
Created March 24, 2017 20:12
Injectable CSS for Hacker News. Better to read. Removes comment box to retain sanity.
table#hnmain {max-width: 800px !important;background-color: #fff !important;}a.storylink {color: #000 !important;}tr.spacer {height: 10px !important;}span.rank {color: #9c9c9c !important;display: none !important;}.votearrow {display: none !important;}span.sitestr {color: #409021 !important;}span.score {display: none !important;}textarea {display: none !important;}input[type="submit"] {display: none !important;}form {display: none !important;}
@JohannMG
JohannMG / RemoveMantleFromSnapsheet.sh
Created February 9, 2017 21:48
Strip Mantle Script
#!/bin/sh
#HOW TO USE
# Get architectures with
# $ lipo -info SnapsheetSDK
# Run the script in the same dir as the binary (binary name in this case is SnapsheetSDK)
# Run script with archs are parameters
# $ ./strip_symbols.sh SnapsheetSDK armv7 armv7s i386 x86_64 arm64