Skip to content

Instantly share code, notes, and snippets.

@jakesylvestre
jakesylvestre / verify_certificate.go
Created January 10, 2021 17:06 — forked from devtdeng/verify_certificate.go
Verify a certificate with chain with golang crypto library
package main
import (
"crypto/x509"
"encoding/pem"
"io/ioutil"
"log"
"os"
)
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@jakesylvestre
jakesylvestre / vultr-coreos-bootstrap.sh
Created October 16, 2019 00:42 — forked from janeczku/vultr-coreos-bootstrap.sh
Cloud-config for CoreOS IPXE deployment on Vultr. Provisioning etcd, fleet, private network and docker compatible firewall. #tags: foo, bar
#!/bin/bash
# Cloud-config for CoreOS IPXE deployment on Vultr
##################################################
# This cloud-config bootstraps CoreOS on /dev/vda and provisions:
# - private ip-address on eth1
# - etcd on private network
# - fleet on private network
# - basic firewall (docker compatible)
# - SSHd security hardening
##################################################
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
import {
createDropdown,
addToolbarToDropdown
} from '@ckeditor/ckeditor5-ui/src/dropdown/utils';
export default class MergeFields extends Plugin {
static get pluginName() {
return 'mergeFields';
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Location</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
@jakesylvestre
jakesylvestre / notifications.blade.php
Created December 19, 2015 02:13 — forked from agarwa13/notifications.blade.php
Laravel 5.1 Blade File that allows us to conveniently notify our users along with any response. Note we are using notifyjs to prettify our notifications.
<script src="{{asset('/vendor/notifyjs/notify.min.js')}}"></script>
<script>
$(document).ajaxComplete(function(event, xhr, settings){
$( ".log" ).text( "Triggered ajaxComplete handler." );
console.log(xhr.responseText);
response = $.parseJSON(xhr.responseText);
// Check for Notifications and Display Them
if(response.hasOwnProperty('notifications')){
for(var i=0; i< response.notifications.length; i++){
@jakesylvestre
jakesylvestre / git-compressing-and-deltas.md
Created September 11, 2015 22:41 — forked from matthewmccullough/git-compressing-and-deltas.md
Git, Compression, and Deltas - An explanation

Git Compression of Blobs and Packfiles.

Many users of Git are curious about the lack of delta compression at the object (blob) level when commits are first written. This efficiency is saved until the pack file is written. Loose objects are written in compressed, but non-delta format at the time of each commit.

A simple run though of a commit sequence with only the smallest change to the image (in uncompressed TIFF format to amplify the observable behavior) aids the understanding of this deferred and different approach efficiency.

The command sequence:

Create the repo:

@jakesylvestre
jakesylvestre / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jakesylvestre
jakesylvestre / gist:f09006e03908f485c07d
Last active August 29, 2015 14:02 — forked from jordelver/gist:3139365
requires sudo priveleges

Find the SD card device

In this case, the SD card is /dev/disk4. DO NOT get this wrong or you may destroy all the data on the wrong disk/card/drive.

diskutil list

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *160.0 GB   disk0

1: EFI 209.7 MB disk0s1