Skip to content

Instantly share code, notes, and snippets.

@ShreyKumar
ShreyKumar / countriesAddressPostal.js
Last active April 2, 2024 17:51
List of countries and their respective postal codes with ranges (August 2020)
// Country list source: https://www.dhl.com/en/country_profile.html#.XwODEJNKjOQ
// Country abbreviation source: https://planetarynames.wr.usgs.gov/Abbreviations
// Postal code: https://gist.githubusercontent.com/jamesbar2/1c677c22df8f21e869cca7e439fc3f5b/raw/21662445653ac861f8ab81caa8cfaee3185aed15/postal-codes.json
// Postal code: https://en.wikipedia.org/wiki/List_of_postal_codes
// Country/territory items with no postal code regexes or ranges either do not require postal codes
// or there may not be enough information for that country/territory
export const COUNTRY_ADDRESS_POSTALS = [{
abbrev: 'AF',
@slightfoot
slightfoot / featured_main.dart
Last active April 8, 2020 14:45
Feature Test App (Looks like this: https://i.imgur.com/4Kl0TL0.png)
@polevaultweb
polevaultweb / ssl.sh
Created January 31, 2018 07:16
Easily create local SSL certificates for development sites that work with you own Certificate Authority https://deliciousbrains.com/ssl-certificate-authority-for-local-https-development/
#!/bin/sh
if [ "$#" -ne 1 ]
then
echo "Usage: Must supply a domain"
exit 1
fi
DOMAIN=$1
@Nks
Nks / MediaVideoConverterListener.php
Last active February 15, 2024 02:18
Laravel Media Library converting video to .mp4 after saving
<?php
namespace App\Listeners;
use App\Media;
use FFMpeg\FFMpeg;
use FFMpeg\Format\Video\X264;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\SerializesModels;
@wbotelhos
wbotelhos / libreadline_6_not_found.sh
Created November 29, 2016 20:42
Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
@sproogen
sproogen / ChildComponent.vue
Last active July 30, 2021 02:40
Vee Validate - Child Component Example
<template>
<div>
<input v-validate data-rules="required" :class="{'has-error': errors.has("textInput")}" id="textInput" name="textInput" type="text">
<span class="error" v-show="errors.has("textInput")">{{ errors.first("textInput") }}</span>
</div>
</template>
<script>
import { find, propEq } from 'ramda'
import bus from './bus'
@AaronGhent
AaronGhent / SlimApp.php
Created December 9, 2015 04:22
Slim App : Pod/Controller Based Routing (Slim 2.6)
<?php
class SlimApp extends \Slim\Slim
{
/**
* Route Groups
*
* This is an override for adding the ability to have a callable class
* to allow for a pod structure / tree hierarchy with individual classes
* containing there own sub routers
@riyazMuhammad
riyazMuhammad / CustomItemClickListener.java
Last active December 30, 2020 15:10
Easy Implementation of RecyclerView custom onItemClickListener
public interface CustomItemClickListener {
public void onItemClick(View v, int position);
}
@dgg
dgg / build.js
Last active August 23, 2017 14:48
automating-phonegap-builds-with-gulp
gulp.task('build', gulpsync.sync(['unlock', 'compress']), function () {
var endpoint = '/apps/' + config.phoneGap.appId;
var env = config.ensure.environment(argv.env, argv.debugmode);
pgBuild.auth({ token: config.phoneGap.authToken }, function (e, api) {
gulp.src('tmp/*.zip').pipe(tap(function (file, t) {
var options = {
form: {
data: {
@vistik
vistik / JsonBodyRequest.php
Created March 16, 2015 12:06
Laravel 5 - Use form request to validate JSON body
<?php
namespace <YourNamespace>\Http\Requests;
// To validate the content of the JSON body instead of query params, you need to override the getValidatorInstance() method to create the validator instance with $this->json()->all() instead for $this->all()
// This way you can keep your Requests as is and just extend this class instead when you need to validate jsonbody instead of query params
abstract class JsonBodyRequest extends Request{
/**