Skip to content

Instantly share code, notes, and snippets.

View ishukshin's full-sized avatar

ishukshin ishukshin

View GitHub Profile
@ishukshin
ishukshin / marcha_imperial
Created January 2, 2018 11:06 — forked from tagliati/marcha_imperial
Marcha imperial para arduino
int ledPin = 13;
//led for visualization (use 13 for built-in led)
int speakerPin = 11;
//speaker connected to one of the PWM ports
#define c 261
#define d 294
#define e 329
#define f 349
@ishukshin
ishukshin / Arduino Song
Created January 2, 2018 11:06 — forked from eznj/star_wars.ino
Arduino Star Wars Song for Piezo
**/
const int c = 261;
const int d = 294;
const int e = 329;
const int f = 349;
const int g = 391;
const int gS = 415;
const int a = 440;
const int aS = 455;
@ishukshin
ishukshin / laravel-routes.php
Created December 20, 2015 16:04 — forked from ibourgeois/laravel-routes.php
Bridging Laravel 5 and Lumen with Guzzle
<?php
// Obviously, you would build up the request somewhere other than a route...
Route::get('/api', function()
{
$client = new \GuzzleHttp\Client();
$response = $client->get('http://path/to/api');
@ishukshin
ishukshin / Rand.php
Last active September 18, 2015 14:26 — forked from Ocramius/Rand.php
MySQL RAND() function in Doctrine2 DQL
<?php
namespace My\Custom\Doctrine2\Function;
/**
* RandFunction ::= "RAND" "(" ")"
*/
class Rand extends FunctionNode
{
public function parse(\Doctrine\ORM\Query\Parser $parser)
@ishukshin
ishukshin / dont-do-this.php
Last active September 18, 2015 10:44 — forked from peterjmit/dont-do-this.php
Some Doctrine 2 Best Practices got here - http://www.uvd.co.uk/blog/some-doctrine-2-best-practices/
<?php
$articles = $article_repository->findAll();
foreach($articles as $article)
{
echo $article->getTitle();
echo count($article->getComments());
}
@ishukshin
ishukshin / gist:af235850ecc8cfce61a6
Last active September 15, 2015 20:30 — forked from antixrist/gist:faf300eb04c1aeca9137
VK API: Parse json Args to array.
/**
* For check: https://vk.com/dev/execute
*/
// var myList = Args.list;
// var listSeparator = Args.listSeparator;
// var listItemsType = Args.listItemsType;
var myList = "123456,789012,345678,901234,567890";
<?php
$fileName = $_FILES['afile']['name'];
$fileType = $_FILES['afile']['type'];
$fileContent = file_get_contents($_FILES['afile']['tmp_name']);
$dataUrl = 'data:' . $fileType . ';base64,' . base64_encode($fileContent);
$json = json_encode(array(
'name' => $fileName,
'type' => $fileType,
'dataUrl' => $dataUrl,