Skip to content

Instantly share code, notes, and snippets.

View Alexufo's full-sized avatar

Alexandr Alexufo

  • Russia, Tula
View GitHub Profile
@sindresorhus
sindresorhus / mysql-backup-windows.bat
Created March 14, 2011 14:50
Backup MySQL databases in separate gzipped sql files on Windows
@echo off
set dbUser=root
set dbPassword=password
set backupDir="C:\Documents and Settings\user\Desktop\backup\mysql"
set mysqldump="C:\Program Files\MySQL\MySQL Workbench 5.2 CE\mysqldump.exe"
set mysqlDataDir="C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data"
set zip="C:\Program Files\7-Zip\7z.exe"
:: get date
@tswann
tswann / makecert.txt
Created May 16, 2011 11:56
Self-Certified SSL Certificates using makecert
# Create a trusted authority
makecert -sv SignRoot.pvk -cy authority -r signroot.cer -a sha1 -n "CN=Dev Cert Authority" -ss my -sr localmachine
# First install root auth certificate above (See comment), then...
# Create authorised certificate for actual use
makecert -iv SignRoot.pvk -ic signroot.cer -cy end -pe -n "CN=localhost" -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localmachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12
@roalcantara
roalcantara / gist:5413630
Last active May 25, 2022 15:00
Checking boolean value of __NSCFBoolean in NSDictionary
id object = [JSON objectForKey:@"Foo"];
NSLog(@"Class: %@", [object class]); //Class: __NSCFBoolean
if([object boolValue]) {
NSLog(@"uhu! \o/");
}
@consti
consti / hosts
Last active May 13, 2024 03:23
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
@thomd
thomd / semantic-layout.html
Last active March 29, 2024 00:27
Standard HTML5 Semantic Layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
<link href="stylesheets/main.css" rel="stylesheet" />
</head>
<body>
<header>
<hgroup>
@milanaryal
milanaryal / schema-org-structured-data-markup-using-microdata.html
Last active November 4, 2023 13:45
An example of how to mark up a HTML5 webpage using the schema.org schemas and microdata.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Site Title</title>
<link rel="stylesheet" href="/assets/css/style.min.css">
@Vestride
Vestride / encoding-video.md
Last active May 17, 2024 06:55
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@wgv-zbonham
wgv-zbonham / GenerateCertificate.md
Last active April 26, 2016 22:40
Generating a private PFX certificate using openssl tools.

This configuration file does not ship with the version of openssl I pulled for some reason. Found a default openssl.cnf

  1. generate an RSA private key
  • openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
  1. write out the RSA private key
  • openssl rsa -passin pass:x -in server.pass.key -out server.key
  1. create the certificate signing request (CSR) for the server or common name;
  • openssl req -new -key server.key -out server.csr -config openssl.cnf -subj "/C=US/ST=TX/L=Allen/O=WatchGuard Video/CN=localhost"
  1. generate the x509 certificate from the request (this certificate will work in Root, but not WebHosting because no private key yet); this is normally handled by certificate CA
  • openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
@zhy0
zhy0 / ubuntu-cli-install-android-sdk.sh
Last active February 3, 2024 08:19
Install Android SDK on headless Ubuntu linux machine via command line, so that you can compile open source Android apps.
#!/bin/bash
# Thanks to https://gist.github.com/wenzhixin/43cf3ce909c24948c6e7
# Execute this script in your home directory. Lines 17 and 21 will prompt you for a y/n
# Install Oracle JDK 8
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
apt-get install -y unzip make # NDK stuff
@allusis
allusis / navigation.pug
Last active March 4, 2023 14:59
Pug nav template with active link checker
block PrimaryNavigation
- var NavItems = [{'url':'home','title':'Home', 'img':'nav','key':'home'},{'url':'about-us','title':'About Us', 'img':'nav','key':'about-us'}];
header
each page,i in NavItems
if PageID === page.url
a(class="active", href= + page.url + '.html')
svg
use(xlink:href= 'img/sprites/' + page.img + '.svg#' + page.key)
span.name= page.title