Skip to content

Instantly share code, notes, and snippets.

@ryu1
ryu1 / jdk8_download.sh
Created November 30, 2022 03:25 — forked from apiOmat/jdk8_download.sh
JDK8 command line download script; For JDK10, please check: https://gist.github.com/P7h/9741922
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget / curl.
### You can download all the binaries one-shot by just providing one BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "VPC knowhow template",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "String",
"MinLength": "1",
"MaxLength": "64",
"AllowedPattern": "[-_ a-zA-Z0-9]*",
import Foundation
import PlaygroundSupport
/// A thread-safe array.
public class SynchronizedArray<Element> {
fileprivate let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent)
fileprivate var array = [Element]()
}
// MARK: - Properties
@ryu1
ryu1 / PHPhotoLibrary+SaveImage
Created April 10, 2018 07:29 — forked from khorbushko/PHPhotoLibrary+SaveImage
PHPhotoLibrary+SaveImage - save image with Photos Framework swift 3
import UIKit
import Photos
extension PHPhotoLibrary {
// MARK: - PHPhotoLibrary+SaveImage
// MARK: - Public
func savePhoto(image:UIImage, albumName:String, completion:((PHAsset?)->())? = nil) {
func save() {
#!/bin/bash
#
# /etc/init.d/storm-nimbus
#
# Startup script for storm-nimbus
#
# chkconfig: 2345 20 80
# description: Starts and stops storm-nimbus
#. /etc/init.d/functions
stormBin=/home/user/storm/storm-0.8.1/bin/storm
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace FileCombiner
{
class Program

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

Project

Description: What does this project do and who does it serve?

Project Setup

How do I, as a developer, start working on the project?

  1. What dependencies does it have (where are they expressed) and how do I install them?
  2. How can I see the project working before I change anything?
public class RedisClient {
private JedisPool pool;
@Inject
public RedisClient(Settings settings) {
try {
pool = new JedisPool(new JedisPoolConfig(), settings.get("redis.host"), settings.getAsInt("redis.port", 6379));
} catch (SettingsException e) {
// ignore
var db = openDatabase("example_db", "", "Example Database", 100000);
// openDatabase(db name, required version (blank string for n/a), human-readable database name, expected size in bytes)
db.changeVersion("", "1", function(t){
t.executeSql("create table ...");
});
/* Note:
openDatabase actually takes one more (optional) argument -- a callback in case the database was /just/ created, for you to call changeVersion and provide an initial schema. However, since this post is more interested in migrations, and because I don't want the initial migration to be a "special case", I'm pretending like it doesn't exist. It's there if you want it, of course.
*/