Skip to content

Instantly share code, notes, and snippets.

View BadChoice's full-sized avatar

Jordi Puigdellívol BadChoice

View GitHub Profile
@i-e-b
i-e-b / reset.txt
Created April 2, 2021 07:03
To reset "Dino World" Secret diary kid's toy
To reset dino world secret diary, hold 1, 3, and 0 together until it opens (about 3 seconds)
then enter new 4 digit code and press #
@mikakane
mikakane / gist:dad182ad9f2039a7328a9ec32a171c74
Last active December 2, 2021 14:58
how to test laravel package inside package

Laravel Package

Create Package

create package directory

$ mkdir modules
$ mkdir modules/some-module
$ cd modules/some-module
extension Encodable {
func encode(with encoder: JSONEncoder = JSONEncoder()) throws -> Data {
return try encoder.encode(self)
}
}
extension Decodable {
static func decode(with decoder: JSONDecoder = JSONDecoder(), from data: Data) throws -> Self {
return try decoder.decode(Self.self, from: data)
}
@norsez
norsez / Date+ISO8601.swift
Created June 21, 2017 05:18
Swift 3: Date <-> ISO 8601 String conversion
extension Date {
static func ISOStringFromDate(date: Date) -> String {
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
dateFormatter.timeZone = TimeZone(abbreviation: "GMT")
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS"
return dateFormatter.string(from: date).appending("Z")
}
@AfricanSwift
AfricanSwift / Default values for enum associated values.md
Last active October 28, 2019 17:49
Evolution Proposal: Default values for enum associated values

Default values for enum associated values

  • Proposal: SE-XXXX
  • Author: African Swift
  • Status: Draft
  • Review manager:

Introduction

Support default values for enum associated values.

@goranprijic
goranprijic / BaseModel.php
Created December 17, 2014 10:12
Check if table is already joined in Laravel Query Builder
<?php
class BaseModel extends Eloquent {
public static function isJoined($query, $table)
{
$joins = $query->getQuery()->joins;
if($joins == null) {
return false;
}