#INSTAGRAM HELPERS
Get username id: https://smashballoon.com/instagram-feed/find-instagram-user-id/
Getting an access token: http://www.benrlodge.com/blog/post/how-to-generate-an-instagram-access-token
##NOT RECOMENDED
| <?php | |
| namespace App\Controller\Component; | |
| use Cake\Controller\Component; | |
| class ZipComponent extends Component | |
| { | |
| public function remove_ext ($filename) | |
| { |
| import {Injectable} from '@angular/core' | |
| import { window } from '@angular/platform-browser/src/facade/browser'; | |
| @Injectable() | |
| export class WindowService | |
| { | |
| constructor(){} | |
| get nativeWindow() : Window | |
| { |
| @keyframes in-top { | |
| 0% { | |
| transform: translateY(-100%); | |
| opacity: 0; | |
| } | |
| 100% { | |
| transform: translateY(0); | |
| opacity: 1; | |
| } | |
| } |
| import {Injectable} from '@angular/core' | |
| import { document } from '@angular/platform-browser/src/facade/browser'; | |
| @Injectable() | |
| export class DocumentService | |
| { | |
| constructor(){} | |
| get nativeDocument() : Document | |
| { |
| <?php | |
| namespace App\Controller\Component; | |
| use Cake\Controller\Component; | |
| class DatabaseArrayComponent extends Component | |
| { | |
| public function decode_array ($string, $level = 0) | |
| { |
| function recurse_copy($src,$dst) { | |
| $dir = opendir($src); | |
| @mkdir($dst); | |
| while(false !== ( $file = readdir($dir)) ) { | |
| if (( $file != '.' ) && ( $file != '..' )) { | |
| if ( is_dir($src . '/' . $file) ) { | |
| recurse_copy($src . '/' . $file,$dst . '/' . $file); | |
| } | |
| else { | |
| copy($src . '/' . $file,$dst . '/' . $file); |
| private function delete_dir($dirPath) | |
| { | |
| if (! is_dir($dirPath)) | |
| { | |
| throw new InvalidArgumentException("$dirPath must be a directory"); | |
| } | |
| if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') | |
| { | |
| $dirPath .= '/'; | |
| } |
| <?php | |
| /** | |
| * @return string | |
| */ | |
| function html_excerpt($string,$length=150,$ending="…") { | |
| $opening_regex = '/((?:<[a-zA-Z0-9="\':.,;\-() ]*>)*)(.*)/'; | |
| $closing_regex = '/(<\/[a-zA-Z0-9="\':.,;\-() ]*>)/'; | |
| $string = trim($string); | |
| $str_len = 0; |
#INSTAGRAM HELPERS
Get username id: https://smashballoon.com/instagram-feed/find-instagram-user-id/
Getting an access token: http://www.benrlodge.com/blog/post/how-to-generate-an-instagram-access-token
##NOT RECOMENDED
#Last used by editor December 2016
#Setting up node
echo "installing node"
cd ~
curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh
nano nodesource_setup.sh
sudo bash nodesource_setup.sh