This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<math.h> | |
float f(float x){ | |
return exp(x); | |
/* | |
return sqrt(1 - 0.162 * sin(x) * sin(x)); | |
*/ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<math.h> | |
float f(float x){ | |
return (4*x-3*x*x); | |
/* | |
return (1/(1+x*x)); | |
*/ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Before: composer require monolog/monolog | |
// composer autoloader | |
require_once 'vendor/autoload.php'; | |
// Shortcuts for simpler usage | |
use \Monolog\Logger; | |
use \Monolog\Formatter\LineFormatter; | |
use \Monolog\Handler\StreamHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*============================================================================== | |
* Register the error handler | |
*/ | |
$whoops = new \Whoops\Run; | |
if ($environment !== 'production') { | |
// show errors for cool kids | |
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler); | |
// log exception |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$app->get('/exception', function ($req, $res, $args) { | |
// errorHandler will trap this Exception | |
throw new Exception("An error happened here"); | |
}); | |
$app->get('/php7', function ($req, $res, $args) { | |
$x = function (int $x) { | |
return $x; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install phpbrew | |
sudo apt-get update | |
sudo apt-get install libmcrypt-dev | |
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew | |
chmod +x phpbrew | |
sudo mv phpbrew /usr/local/bin/ | |
phpbrew init | |
[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*------------------------------------------ | |
Responsive Grid Media Queries - 1280, 1024, 768, 480 | |
1280-1024 - desktop (default grid) | |
1024-768 - tablet landscape | |
768-480 - tablet | |
480-less - phone landscape & smaller | |
--------------------------------------------*/ | |
@media all and (min-width: 1024px) and (max-width: 1280px) { } | |
@media all and (min-width: 768px) and (max-width: 1024px) { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################## | |
#!/bin/bash | |
# update the sources | |
sudo apt update | |
echo "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::updated apt repos" | |
sleep 2 | |
# install zip & git | |
sudo apt -y install zip git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shows a dialog that allows the user to install the current instant app. | |
// https://developer.android.com/topic/instant-apps/reference.html#showinstallprompt | |
InstantApps.showInstallPrompt(this, new Intent(this, BaseActivity.class), 0, null); |