Skip to content

Instantly share code, notes, and snippets.

View ktamas77's full-sized avatar
🏠
Working from home

Tamas Kalman ktamas77

🏠
Working from home
View GitHub Profile
@dmitrybitman
dmitrybitman / pre-commit
Created March 5, 2012 11:56
php code sniffer pre-commit
#!/bin/bash
# PHP CodeSniffer pre-commit hook for git
#
# @author Soenke Ruempler <soenke@ruempler.eu>
# @author Sebastian Kaspari <s.kaspari@googlemail.com>
#
# see the README
PHPCS_BIN=/usr/bin/phpcs
PHPCS_CODING_STANDARD="$(git rev-parse --show-toplevel)/doc/CodeStandard.xml"
@kevcao
kevcao / phplog
Created July 6, 2012 00:51
phplog
#!/usr/bin/php
<?php
print_r($argv);
if (count($argv) < 3) {
die("wrong number of arguments\n");
}
@mbeale
mbeale / gist:4741709
Last active December 12, 2015 08:08
Complete example for PHP Recurly.js BuildSubscriptionForm
<?php
require_once('recurlyphp/lib/recurly.php');
// Required for the API
Recurly_Client::$subdomain = 'yoursubdomain'
Recurly_Client::$apiKey = 'apikey';
Recurly_js::$privateKey = 'privatekey';
$signature = Recurly_js::sign(array('account'=>array('account_code'=>'aaa1234588'),'subscription' => array(
'plan_code' => 'plan_trial',
#include "sha1.h"
#include <SoftwareSerial.h>
SoftwareSerial SerialRNXV(2, 3);
int irVal = 0;
int distOn = 0; // getting distance
const int ms = 1; // unit of milliseconds
bool authed = false;
@iaserrat
iaserrat / FBLogin.swift
Last active April 7, 2016 06:16
This is a swift port of the official FacebookSDK login tutorial. It's been tested on Xcode 6 Beta 1 with the iOS 8 Simulator. You can find the official FB tutorial here: https://developers.facebook.com/docs/facebook-login/ios/v2.0
// YourProject-Bridging-Header.h
#import <FacebookSDK/FacebookSDK.h>
// AppDelegate.swift
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
.
@pingud98
pingud98 / Graphicequal
Created October 9, 2013 22:53
Graphic equaliser in processing (equalizer)
/**
Hacked together from the minim tutorial examples
**/
import ddf.minim.analysis.*;
import ddf.minim.*;
Minim minim;
//AudioPlayer jingle;
FFT fftLin;
@XueshiQiao
XueshiQiao / gource.sh
Last active November 10, 2019 15:56 — forked from cgoldberg/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
@RobThree
RobThree / SoapClientTimeout.class.php
Created April 25, 2012 14:55
PHP SoapClient with timeout
<?php
//Drop-in replacement for PHP's SoapClient class supporting connect and response/transfer timeout
//Usage: Exactly as PHP's SoapClient class, except that 3 new options are available:
// timeout The response/transfer timeout in milliseconds; 0 == default SoapClient / CURL timeout
// connecttimeout The connection timeout; 0 == default SoapClient / CURL timeout
// sslverifypeer FALSE to stop SoapClient from verifying the peer's certificate
class SoapClientTimeout extends SoapClient
{
private $timeout = 0;
private $connecttimeout = 0;
@robertsdionne
robertsdionne / deepdream-install.md
Last active February 15, 2021 16:07
Deepdream installation
#!/usr/bin/env bash

# Assuming OS X Yosemite 10.10.4

# Install XCode and command line tools
# See https://itunes.apple.com/us/app/xcode/id497799835?mt=12#
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html
xcode-select --install
@UndefinedOffset
UndefinedOffset / nr-deploy-post-merge-hook.sh
Last active July 9, 2021 10:19
A simple git deploy hook for notifying New Relic of deployments, it assumes that the base folder name of the repository is the application name. To set git to use this script you simply add this file into your .git/hooks folder as "post-merge".
#!/bin/bash
#New Relic API Key see https://docs.newrelic.com/docs/apis/rest-api-v2/requirements/api-key#creating
NR_API_KEY="INSERT_API_KEY_HERE"
#Find New Relic App Name, if your top level folder is not the name of your application change the below two lines to simply NR_APP_NAME="MY_APP_NAME".
NR_APP_NAME=$(git rev-parse --show-toplevel)
NR_APP_NAME=$(basename "$NR_APP_NAME")
#Get the current git branch