Skip to content

Instantly share code, notes, and snippets.

View glee2017's full-sized avatar

glee2017 glee2017

View GitHub Profile
openssl req -newkey rsa:2048 -new -nodes -keyout privatekey.pem -out csr.pem
openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out server.crt
@glee2017
glee2017 / gist:fd13d900311adf0eceaf43ff9215a878
Created May 3, 2018 16:37
check if checkboxes are all checked or all unchecked using class selector
if ( $(".children_checkboxes:checked").length == $(".children_checkboxes").length )
{
$("#parent").prop("checked", true);
}else {
$("#parent").prop("checked", false);
}
var http = require('http');
http.createServer(function(req, res) {
const https = require('https');
//https.get('https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY', (resp) => {
https.get('https://graph.facebook.com/517267866/?fields=picture', (resp) => {
let data = '';
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray"/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@android:color/darker_gray"/>
@glee2017
glee2017 / gist:7a02ef83e3b97252b4d540464f4575cd
Created March 28, 2018 16:53
Shell script for old awstats updates
#!/bin/sh
for m in 01 02 03 04 05 06 07 08 09 10 11 12
do
for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
do
./awstats.pl -config=somename.host.com -Logfile=/WWW/logs/somename.host.com/2017/$m/$i/access_log -update
done
done
<script>
$( document ).ready(function() {
var field1 = $('#field1').text();
var field2 = $('#field2').text();
var field3 = $('#field3').text();
$( "#submit_btn" ).click(function( event ) {
$.post( "proc.php", { field1:field1, field2:field2, field3:field13
},
@glee2017
glee2017 / gist:234541d79921727159e29865dda6af61
Created March 14, 2018 14:34
Boostrap 4 Form validation JS
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$( document ).ready(function() {
(function() {
'use strict';
var forms = document.getElementsByClassName('needs-validation');
var validation = Array.prototype.filter.call(forms, function(form) {