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
| import { writable } from 'svelte/store' | |
| // returns a store with HTTP access functions for get, post, patch, delete | |
| // anytime an HTTP request is made, the store is updated and all subscribers are notified. | |
| export default function(initial) { | |
| // create the underlying store | |
| const store = writable(initial) | |
| // define a request function that will do `fetch` and update store when request finishes | |
| store.request = async (method, url, params=null) => { |
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 | |
| /** | |
| * When using the WordPress Importer, update existing | |
| * posts instead of skipping them. Updates content according | |
| * to the import file even if the existing post was updated | |
| * more recently. | |
| * | |
| * To use, drop this file into your /mu-plugins/ folder or | |
| * copy this code into your functions.php file. |
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 express = require('express'); | |
| var fs = require('fs'); | |
| var bodyParser = require('body-parser'); | |
| var app = express(); | |
| app.use(bodyParser.urlencoded({ extended: true })); | |
| app.use(bodyParser.json()); // Body parser use JSON data | |
| app.post('/launches', function(req, res) { |
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/local/bin/php | |
| <?php | |
| /* | |
| * CLI to convert a PHP array to a YAML file. | |
| */ | |
| error_reporting(E_ALL ^ E_NOTICE); | |
| date_default_timezone_set('UTC'); | |
| require_once 'vendor/autoload.php'; |
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 ( | |
| "github.com/gin-gonic/gin" | |
| "github.com/jinzhu/gorm" | |
| _ "github.com/mattn/go-sqlite3" | |
| ) | |
| type Users struct { | |
| Id int `gorm:"AUTO_INCREMENT" form:"id" json:"id"` |
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 | |
| /** | |
| * When using the WordPress Importer, update existing | |
| * posts instead of skipping them. Updates content according | |
| * to the import file even if the existing post was updated | |
| * more recently. | |
| * | |
| * To use, drop this file into your /mu-plugins/ folder or | |
| * copy this code into your functions.php file. |
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 | |
| /********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
| /* Create a Yoast SEO sitemap for a custom post type | |
| * Credit: Team Yoast | |
| * Last Tested: Unknown | |
| * Documentation: https://developer.yoast.com/features/xml-sitemaps/api/#add-a-custom-post-type | |
| * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
| * HOW TO USE | |
| * Replace TYPE with your custom type |
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 example | |
| import ( | |
| "fmt" | |
| "math/rand" | |
| "net/http" | |
| "google.golang.org/appengine" | |
| "google.golang.org/appengine/file" | |
| "google.golang.org/appengine/log" |
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 | |
| /** | |
| * @website http://albulescu.ro | |
| * @author Cosmin Albulescu <cosmin@albulescu.ro> | |
| */ | |
| import ( | |
| "bytes" | |
| "fmt" |
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
| // Now available in package form at https://github.com/rjz/githubhook | |
| package handler | |
| // https://developer.github.com/webhooks/ | |
| import ( | |
| "crypto/hmac" | |
| "crypto/sha1" | |
| "encoding/hex" | |
| "errors" |
NewerOlder