Skip to content

Instantly share code, notes, and snippets.

@chlegou
chlegou / mysql-docker.sh
Created April 26, 2023 12:17 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@chlegou
chlegou / SSLExcludeCipherConnectionHelper.java
Created May 10, 2021 23:05 — forked from hoangthienan/SSLExcludeCipherConnectionHelper.java
Here is my solution (java 1.6) removing TLS_DHE_ ciphers completely
package com.vht.sms.content.util;
import java.io.*;
import java.net.*;
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
package com.digikey.mobile.action.wsclient;
import com.digikey.mobile.BuildConfig;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.SocketAddress;
@chlegou
chlegou / responsive-stepper.component.ts
Created April 2, 2020 01:30 — forked from davideas/responsive-stepper.component.ts
Angular 8.x Responsive Stepper with headers disable feature
import { Directionality } from '@angular/cdk/bidi';
import { CdkStep, CdkStepper, StepperSelectionEvent } from '@angular/cdk/stepper';
import {
AfterViewChecked,
AfterViewInit,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ContentChildren,
ElementRef,
@chlegou
chlegou / meta-tags.md
Created December 27, 2018 17:25 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@chlegou
chlegou / timezones.js
Created April 23, 2018 14:21 — forked from themeteorchef/timezones.js
Array of timezones as objects, sorted by offset and name.
[
  {
    "offset": "GMT-12:00",
    "name": "Etc/GMT-12"
  },
  {
    "offset": "GMT-11:00",
    "name": "Etc/GMT-11"
  },
  {
@chlegou
chlegou / Javascript ISO country code to country name conversion
Created April 23, 2018 14:02 — forked from themeteorchef/Javascript ISO country code to country name conversion
ISO 3166-1 alpha-2 country code to country name conversion with a simple Javascript implementation, an array and a function.
var isoCountries = {
'AF' : 'Afghanistan',
'AX' : 'Aland Islands',
'AL' : 'Albania',
'DZ' : 'Algeria',
'AS' : 'American Samoa',
'AD' : 'Andorra',
'AO' : 'Angola',
'AI' : 'Anguilla',
'AQ' : 'Antarctica',