Skip to content

Instantly share code, notes, and snippets.

@schnabear
schnabear / code.js
Created September 16, 2025 13:02
iCloud Locker
// ==UserScript==
// @name iCloud Locker
// @namespace http://schnabear.github.io/
// @version 2025-04-14
// @description iSee iType iLock iLMAO
// @author schnabear
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js
// @run-at document-end
// @match *://www.icloud.com/
// @match *://idmsa.apple.com/*
@schnabear
schnabear / CompositeKey.php
Created September 10, 2019 08:51
Laravel Composite Key Trait
<?php
namespace App\Models\Traits;
use Illuminate\Database\Eloquent\Builder;
trait CompositeKey
{
/**
* Get the value indicating whether the IDs are incrementing.
@schnabear
schnabear / updateBadge.html
Created December 5, 2018 09:15
updateBadge HTML
<!DOCTYPE html>
<html>
<head>
<title>updateBadge</title>
<script>
function updateBadgeCount() {
var badgeCountEl = document.querySelector('#badgeCount');
var customLocation = "native://updateBadge?count=" + badgeCountEl.value;
console.log(customLocation);
document.location.href = customLocation;
@schnabear
schnabear / marker.html
Last active October 26, 2018 02:01
OSM Leaflet
<!DOCTYPE html>
<html>
<head>
<title>OSM</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<style>
html, body {
height: 100%;
margin: 0;
package main
import (
"fmt"
"golang.org/x/tour/tree"
)
// Walk walks the tree t sending all values
// from the tree to the channel ch.
@schnabear
schnabear / ubi30.html
Created November 29, 2016 04:30
UBI30 Giveaway
<!DOCTYPE html>
<html>
<body>
<script>
var totalGiveaway = 30;
var totalLoaded = 0;
var body = document.querySelector('body');
for (var i = 1; i <= totalGiveaway; i++) {
var source = 'https://30days.ubi.com/Promotion/RedeemCode/?giveAwayId=giveaway';
if (i > 1) {
@schnabear
schnabear / request.php
Created November 15, 2016 08:02
PUT GET PHP
<?php
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
// $_SERVER['QUERY_STRING']
echo $_GET['foo'];
echo $_GET['bar'];
} elseif ($_SERVER['REQUEST_METHOD'] == 'PUT') {
parse_str(file_get_contents("php://input"), $_PUT);
echo $_PUT['foo'];
echo $_PUT['bar'];
@schnabear
schnabear / verify_apple_receipt.php
Created September 21, 2016 05:53
PHP Apple Receipt Verification Function
<?php
// http://stackoverflow.com/questions/19785803/validating-appreceiptstoreurl-returning-21002-status
// http://stackoverflow.com/questions/19222845/ios7-receipts-not-validating-at-sandbox-error-21002-java-lang-illegalargume
function verify_curl($base64receipt, $sandbox = false)
{
if ($sandbox) {
$url = 'https://sandbox.itunes.apple.com/verifyReceipt';
} else {
@schnabear
schnabear / export-chat.js
Last active February 13, 2023 02:24
ChatWork Export Chat
var output = '';
function toYMDHMS(timestamp) {
var a = new Date(timestamp * 1000);
var year = a.getFullYear();
var month = ('0' + (a.getMonth() + 1)).slice(-2);
var date = ('0' + a.getDate()).slice(-2);
var hour = a.getHours();
var minute = a.getMinutes();
var second = a.getSeconds();
return year + '/' + month + '/' + date + ' ' + hour + ':' + minute + ':' + second;
@schnabear
schnabear / git-mass-merge.py
Last active October 11, 2018 07:58
Git Mass Merge
#!/usr/bin/env python
import argparse
import subprocess
def main():
parser = argparse.ArgumentParser(description='Git Mass Merge')
parser.add_argument('-p', type=str, required=True, dest='parent_branch')
parser.add_argument('-c', type=str, required=True, dest='child_branch', nargs='+')
parser.add_argument('-u', action='store_true', default=False, dest='is_update_upstream')