Skip to content

Instantly share code, notes, and snippets.

@newbdez33
newbdez33 / basic_pixels_3.js
Last active February 6, 2019 02:20
[p5js] pixels project #monster
//http://compform.net/js_lab/js_lab.html?/pixels/sketches/basic_pixels_3.js
//https://p5js.org/examples/advanced-data-load-saved-json.html
// require https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.14/p5.js
function setup() {
createCanvas(500, 500);
}
function draw() {
<?php
/*
* qtfaststart.php v0.1 by Valentin Schmidt
* based on qt-faststart.c v0.2 by Mike Melanson (melanson@pcisys.net)
*
* This file is placed in the public domain. Use the program however you
* see fit.
*
* This utility rearranges a Quicktime file such that the moov atom
* is in front of the data, thus facilitating network streaming.
@newbdez33
newbdez33 / AmazonProduct.swift
Created June 19, 2017 02:16 — forked from coryalder/AmazonProduct.swift
Amazon Product Advertising API + Alamofire
//
// AmazonProduct.swift
// Requires SHXMLParser for parsing Amazon's XML responses (https://github.com/simhanature/SHXMLParser)
//
// Created by Cory Alder on 2015-01-11.
// Copyright (c) 2015 Davander Mobile Corporation. All rights reserved.
//
// partly inspired by RWMAmazonProductAdvertisingManager
import Alamofire
@newbdez33
newbdez33 / SmartSpeed.swift
Created June 13, 2017 16:02 — forked from tonnylitao/SmartSpeed.swift
Smart Speed like Overcast. Smart Speed means shorten the silence of audio for saving time.
do {
try audioPlayer = AVAudioPlayer(contentsOf: url)
audioPlayer.isMeteringEnabled = true
audioPlayer.enableRate = true
audioPlayer.prepareToPlay()
} catch let error as NSError {
print("audioPlayer error \(error.localizedDescription)")
}
audioPlayer.play()
NSURLErrorUnknown = -1,
NSURLErrorCancelled = -999,
NSURLErrorBadURL = -1000,
NSURLErrorTimedOut = -1001,
NSURLErrorUnsupportedURL = -1002,
NSURLErrorCannotFindHost = -1003,
NSURLErrorCannotConnectToHost = -1004,
NSURLErrorNetworkConnectionLost = -1005,
NSURLErrorDNSLookupFailed = -1006,
NSURLErrorHTTPTooManyRedirects = -1007,

UICollectionView Simple Template

import UIKit

class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {
    
    @IBOutlet weak var collectionView: UICollectionView!
    
    override func viewDidLoad() {
@newbdez33
newbdez33 / vpnserver.sh
Created January 3, 2017 01:11 — forked from kevinzhow/vpnserver.sh
OnClickVPNServer
#!/usr/bin/env bash
echo 'deb http://shadowsocks.org/debian wheezy main' >> /etc/apt/sources.list
# Pre-requisites
sudo apt-get -y update
sudo apt-get -y install pptpd
sudo apt-get -y install fail2ban
sudo apt-get -y install shadowsocks-libev
@newbdez33
newbdez33 / gist:86d3dc1cc55e5cfbacba
Created March 14, 2016 08:22 — forked from dopa/gist:5245868
Shell Script to Back Up all MySQL Databases, Keep 7 Days of Backups
#!/bin/bash
# Script will output dumps for all databases using seperate files
# Derived from this post: http://www.cyberciti.biz/faq/ubuntu-linux-mysql-nas-ftp-backup-script/
USER="root"
PASSWORD="SnM1073k"
HOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
OUTPUT_DIR="/backups/files"
@newbdez33
newbdez33 / cheasing-api.md
Last active August 29, 2015 14:17
追逐营销API

获得所有用户点信息

返回符合条件的所有用户JSON数据

  • URL

    /nodes

  • Method:

@newbdez33
newbdez33 / API.md
Last active August 29, 2015 14:17 — forked from iros/API.md

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: