This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models\Traits; | |
use Illuminate\Database\Eloquent\Builder; | |
trait CompositeKey | |
{ | |
/** | |
* Get the value indicating whether the IDs are incrementing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"golang.org/x/tour/tree" | |
) | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Netmask Netmask (binary) CIDR Notes | |
_____________________________________________________________________________ | |
255.255.255.255 11111111.11111111.11111111.11111111 /32 Host (single addr) | |
255.255.255.254 11111111.11111111.11111111.11111110 /31 Unuseable | |
255.255.255.252 11111111.11111111.11111111.11111100 /30 2 useable | |
255.255.255.248 11111111.11111111.11111111.11111000 /29 6 useable | |
255.255.255.240 11111111.11111111.11111111.11110000 /28 14 useable | |
255.255.255.224 11111111.11111111.11111111.11100000 /27 30 useable | |
255.255.255.192 11111111.11111111.11111111.11000000 /26 62 useable | |
255.255.255.128 11111111.11111111.11111111.10000000 /25 126 useable |
NewerOlder