Skip to content

Instantly share code, notes, and snippets.

View dewwwald's full-sized avatar

dewald dewwwald

View GitHub Profile
@dewwwald
dewwwald / DatabaseArrayComponent.php
Last active August 12, 2016 07:34
CakePhp Component: write arrays to database and back, with tests.
<?php
namespace App\Controller\Component;
use Cake\Controller\Component;
class DatabaseArrayComponent extends Component
{
public function decode_array ($string, $level = 0)
{
@dewwwald
dewwwald / document.service.ts
Created August 4, 2016 05:56
Angular2 service for document
import {Injectable} from '@angular/core'
import { document } from '@angular/platform-browser/src/facade/browser';
@Injectable()
export class DocumentService
{
constructor(){}
get nativeDocument() : Document
{
@dewwwald
dewwwald / _animations.scss
Created August 4, 2016 05:53
Slide from side of hover.
@keyframes in-top {
0% {
transform: translateY(-100%);
opacity: 0;
}
100% {
transform: translateY(0);
opacity: 1;
}
}
@dewwwald
dewwwald / window.service.ts
Created August 4, 2016 05:53
Angular2 Service for window
import {Injectable} from '@angular/core'
import { window } from '@angular/platform-browser/src/facade/browser';
@Injectable()
export class WindowService
{
constructor(){}
get nativeWindow() : Window
{
@dewwwald
dewwwald / ZipComponent.php
Created August 1, 2016 14:03
Cake Zip Component
<?php
namespace App\Controller\Component;
use Cake\Controller\Component;
class ZipComponent extends Component
{
public function remove_ext ($filename)
{
@dewwwald
dewwwald / _A.md
Last active August 19, 2016 12:26
Wordpress migration workflow
@dewwwald
dewwwald / _A.md
Last active August 2, 2016 07:08
Yosemite Installation of Mysql
@dewwwald
dewwwald / gulp_ftp.coffee
Last active November 19, 2015 05:52
FTP for gulp
fs = require "fs"
ftp = require 'gulp-ftp'
cleanFtpList = () ->
ftpJsonFile = process.cwd() + '/.ftp.json'
# clean ftp list
fs.writeFile ftpJsonFile, JSON.stringify(new Array()), (err) ->
if(err)
return gutil.log gutil.colors.red err
gutil.log(gutil.colors.yellow("Cleaned ftp list..."))
@dewwwald
dewwwald / _!A.md
Last active August 2, 2016 07:08
Just an Idea on how to style lists Styling lists is a mission.

#Just an Idea on how to style lists

@dewwwald
dewwwald / salesforce.php
Created November 1, 2015 20:00
Submit post processed form to salesforce using CURL
public function submit_to_salesforce () {
$post_fields = http_build_query(array_merge($this->conf_fields, $this->fields));
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,self::$config['url']);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
//execute post